Skip to content

Commit

Permalink
Merge branch 'tesla_devel' into tesla_alpha_0.6.5_dm
Browse files Browse the repository at this point in the history
  • Loading branch information
BogGyver authored Oct 30, 2019
2 parents da8f168 + 9e82e2e commit 9929061
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion selfdrive/car/modules/ALCA_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
ALCA_DEBUG = True
DEBUG_INFO = "step {step} of {total_steps}: direction = {ALCA_direction} | using visual = {ALCA_use_visual} | over line = {ALCA_over_line} | lane width = {ALCA_lane_width} | left to move = {left_to_move} | from center = {from_center} | C2 offset = {ALCA_OFFSET_C2} | C1 offset = {ALCA_OFFSET_C1} | Prob Low = {prob_low} | Prob High = {prob_high}"


class ALCAController():
def __init__(self,carcontroller,alcaEnabled,steerByAngle):
#import settings
Expand Down Expand Up @@ -309,7 +310,6 @@ def update(self, v_ego, md, r_poly, l_poly, r_prob, l_prob, lane_width, p_poly):
if socket is self.alcaStatus:
self.alcas = tesla.ALCAStatus.from_bytes(socket.recv())


#if we don't have yet ALCA status, return same values
if self.alcas is None:
self.send_state()
Expand Down Expand Up @@ -352,7 +352,10 @@ def update(self, v_ego, md, r_poly, l_poly, r_prob, l_prob, lane_width, p_poly):
self.ALCA_error = False

if self.ALCA_enabled and not (self.ALCA_direction == 0):

self.ALCA_step += 1 #ALCA_increment


if (self.ALCA_step < 0) or (self.ALCA_step >= self.ALCA_total_steps):
#done so end ALCA
self.debug_alca(" step out of bounds -> resetting...")
Expand Down Expand Up @@ -417,6 +420,7 @@ def update(self, v_ego, md, r_poly, l_poly, r_prob, l_prob, lane_width, p_poly):
r_poly[2] += self.ALCA_OFFSET_C2
l_poly[1] += self.ALCA_OFFSET_C1
r_poly[1] += self.ALCA_OFFSET_C1

else:
self.reset_alca()
self.ALCA_error = False
Expand Down
1 change: 1 addition & 0 deletions selfdrive/car/tesla/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def get_params(candidate, fingerprint, vin="", is_panda_black=False):
ret.steerLimitAlert = False
ret.startAccel = 0.5
ret.steerRateCost = 1.0

ret.radarOffCan = not CarSettings().get_value("useTeslaRadar")

return ret
Expand Down
4 changes: 3 additions & 1 deletion selfdrive/car/tesla/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def _create_radard_can_parser():

checks = list(zip(RADAR_A_MSGS + RADAR_B_MSGS, [6]*(msg_a_n + msg_b_n)))


return CANParser(os.path.splitext(dbc_f)[0].encode('utf8'), signals, checks, 1)


Expand Down Expand Up @@ -82,6 +83,7 @@ def update(self, can_strings):
if not self.useTeslaRadar:
time.sleep(0.05)
return car.RadarData.new_message(),self.extPts.values()

if can_strings != None:
vls = self.rcp.update_strings(can_strings)
self.updated_messages.update(vls)
Expand All @@ -93,7 +95,7 @@ def update(self, can_strings):
return None,None

rr,rrext = self._update(self.updated_messages)
self.updated_messages.clear()
#self.updated_messages.clear()
return rr,rrext


Expand Down

0 comments on commit 9929061

Please sign in to comment.