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

Method _is_walker_hazard

leaderboard/team_code/roach_ap_agent.py:377–397  ·  view source on GitHub ↗
(self, walkers_list)

Source from the content-addressed store, hash-verified

375 return any(x is not None for x in [vehicle, walker])
376
377 def _is_walker_hazard(self, walkers_list):
378 z = self._ego_vehicle.get_location().z
379 p1 = _numpy(self._ego_vehicle.get_location())
380 v1 = 10.0 * _orientation(self._ego_vehicle.get_transform().rotation.yaw)
381
382 for walker in walkers_list:
383 v2_hat = _orientation(walker.get_transform().rotation.yaw)
384 s2 = np.linalg.norm(_numpy(walker.get_velocity()))
385
386 if s2 < 0.05:
387 v2_hat *= s2
388
389 p2 = -3.0 * v2_hat + _numpy(walker.get_location())
390 v2 = 8.0 * v2_hat
391
392 collides, collision_point = get_collision(p1, v1, p2, v2)
393
394 if collides:
395 return walker
396
397 return None
398
399 def _is_vehicle_hazard(self, vehicle_list):
400 z = self._ego_vehicle.get_location().z

Callers 1

collision_detectMethod · 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