Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nue #3

Merged
merged 3 commits into from
Oct 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions selfdrive/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,32 +239,33 @@ def update(self, sendcan, enabled, CS, frame, actuators,
if BLINDSPOTDEBUG:
self.blindspot_poll_counter += 1
if self.blindspot_poll_counter > 1000: # 10 seconds after start
if CS.left_blinker_on:
self.blindspot_blink_counter_left += 1
#print "debug Left Blinker on"
elif CS.right_blinker_on:
self.blindspot_blink_counter_right += 1
else:
self.blindspot_blink_counter_left = 0
self.blindspot_blink_counter_right = 0
#print "debug Left Blinker off"
if self.blindspot_debug_enabled_left:
can_sends.append(set_blindspot_debug_mode(LEFT_BLINDSPOT, False))
self.blindspot_debug_enabled_left = False
#print "debug Left blindspot debug disabled"
if self.blindspot_debug_enabled_right:
can_sends.append(set_blindspot_debug_mode(RIGHT_BLINDSPOT, False))
self.blindspot_debug_enabled_right = False
#print "debug Right blindspot debug disabled"
if self.blindspot_blink_counter_left > 199 and not self.blindspot_debug_enabled_left: #After 2 seconds of blinking check blindspot
#if CS.left_blinker_on:
self.blindspot_blink_counter_left += 1
#print "debug Left Blinker on"
#elif CS.right_blinker_on:
self.blindspot_blink_counter_right += 1
#else:
# self.blindspot_blink_counter_left = 0
# self.blindspot_blink_counter_right = 0
# #print "debug Left Blinker off"
# if self.blindspot_debug_enabled_left:
# can_sends.append(set_blindspot_debug_mode(LEFT_BLINDSPOT, False))
# self.blindspot_debug_enabled_left = False
# #print "debug Left blindspot debug disabled"
# if self.blindspot_debug_enabled_right:
# can_sends.append(set_blindspot_debug_mode(RIGHT_BLINDSPOT, False))
# self.blindspot_debug_enabled_right = False
# #print "debug Right blindspot debug disabled"

if not self.blindspot_debug_enabled_left: #enable blindspot debug mode
can_sends.append(set_blindspot_debug_mode(LEFT_BLINDSPOT, True))
#print "debug Left blindspot debug enabled"
self.blindspot_debug_enabled_left = True
if self.blindspot_blink_counter_right > 195 and not self.blindspot_debug_enabled_left: #After 2 seconds of blinking check blindspot
if CS.v_ego > 6: #polling at low speeds switches camera off
can_sends.append(set_blindspot_debug_mode(RIGHT_BLINDSPOT, True))
#print "debug Left blindspot debug enabled"
self.blindspot_debug_enabled_right = True
if not self.blindspot_debug_enabled_left: #enable blindspot debug mode
#if CS.v_ego > 6: #polling at low speeds switches camera off
can_sends.append(set_blindspot_debug_mode(RIGHT_BLINDSPOT, True))
#print "debug Left blindspot debug enabled"
self.blindspot_debug_enabled_right = True
if self.blindspot_debug_enabled_left:
if self.blindspot_poll_counter % 20 == 0 and self.blindspot_poll_counter > 1001: # Poll blindspots at 5 Hz
can_sends.append(poll_blindspot_status(LEFT_BLINDSPOT))
Expand Down