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

Method _is_walker_hazard

leaderboard/team_code/auto_pilot.py:317–337  ·  view source on GitHub ↗
(self, walkers_list)

Source from the content-addressed store, hash-verified

315 return None
316
317 def _is_walker_hazard(self, walkers_list):
318 z = self._vehicle.get_location().z
319 p1 = _numpy(self._vehicle.get_location())
320 v1 = 10.0 * _orientation(self._vehicle.get_transform().rotation.yaw)
321
322 for walker in walkers_list:
323 v2_hat = _orientation(walker.get_transform().rotation.yaw)
324 s2 = np.linalg.norm(_numpy(walker.get_velocity()))
325
326 if s2 < 0.05:
327 v2_hat *= s2
328
329 p2 = -3.0 * v2_hat + _numpy(walker.get_location())
330 v2 = 8.0 * v2_hat
331
332 collides, collision_point = get_collision(p1, v1, p2, v2)
333
334 if collides:
335 return walker
336
337 return None
338
339 def _is_vehicle_hazard(self, vehicle_list):
340 z = self._vehicle.get_location().z

Callers 1

_should_brakeMethod · 0.95

Calls 6

get_locationMethod · 0.80
get_transformMethod · 0.80
get_velocityMethod · 0.80
_numpyFunction · 0.70
_orientationFunction · 0.70
get_collisionFunction · 0.70

Tested by

no test coverage detected