Skip to content

Commit

Permalink
AHB tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
BogGyver committed Nov 15, 2019
1 parent fc38bab commit 68158e0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions selfdrive/car/tesla/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#RADAR_A_MSGS = list(range(0x371, 0x37F , 3))
#RADAR_B_MSGS = list(range(0x372, 0x37F, 3))
BOSCH_MAX_DIST = 150. #max distance for radar
BOSCH_MAX_DIST = 250. #max distance for radar
RADAR_A_MSGS = list(range(0x310, 0x36F , 3))
RADAR_B_MSGS = list(range(0x311, 0x36F, 3))
OBJECT_MIN_PROBABILITY = 20.
Expand All @@ -21,9 +21,9 @@
VALID_MESSAGE_COUNT_THRESHOLD = 4
#these are settings for Auto High Beam
#they are use to detect objects that are moving either in the same direction with us or towards us
AHB_VALID_MESSAGE_COUNT_THRESHOLD = -1 # -1 to use any point
AHB_OBJECT_MIN_PROBABILITY = 0. # 0. to use any point
AHB_CLASS_MIN_PROBABILITY = 0. # 0. to use any point
AHB_VALID_MESSAGE_COUNT_THRESHOLD = 1 # -1 to use any point
AHB_OBJECT_MIN_PROBABILITY = 5. # 0. to use any point
AHB_CLASS_MIN_PROBABILITY = 5. # 0. to use any point
AHB_INCOMING_CAR_SPEED_FACTOR = -1.3 # needs to be negative, moving towards us, and more than our speed


Expand Down Expand Up @@ -136,7 +136,7 @@ def _update(self, updated_messages,v_ego):
del self.extPts[message]

# this is the logic used for Auto High Beam (AHB) car detection
if (True or cpt['Tracked']) and (cpt['LongDist']>0) and (cpt['LongDist'] < BOSCH_MAX_DIST) and \
if (cpt['LongDist']>0) and (cpt['LongDist'] < BOSCH_MAX_DIST) and \
(self.valid_cnt[message] > AHB_VALID_MESSAGE_COUNT_THRESHOLD) and (cpt['ProbExist'] >= AHB_OBJECT_MIN_PROBABILITY) and \
(cpt2['Class'] < 4) and (cpt2['ProbClass'] >= AHB_CLASS_MIN_PROBABILITY):
# if moving or the relative speed is x% larger than our speed then use to turn high beam off
Expand Down

0 comments on commit 68158e0

Please sign in to comment.