MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / tick

Method tick

roach/criteria/encounter_light.py:10–26  ·  view source on GitHub ↗
(self, vehicle, timestamp)

Source from the content-addressed store, hash-verified

8 self._dist_threshold = dist_threshold
9
10 def tick(self, vehicle, timestamp):
11 info = None
12
13 light_state, light_loc, light_id = TrafficLightHandler.get_light_state(
14 vehicle, dist_threshold=self._dist_threshold)
15
16 if light_id is not None:
17 if light_id != self._last_light_id:
18 self._last_light_id = light_id
19 info = {
20 'step': timestamp['step'],
21 'simulation_time': timestamp['relative_simulation_time'],
22 'id': light_id,
23 'tl_loc': light_loc.tolist()
24 }
25
26 return info

Callers

nothing calls this directly

Calls 1

get_light_stateMethod · 0.80

Tested by

no test coverage detected