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

Method _baseline_to_box

leaderboard/team_code/base_agent.py:602–617  ·  view source on GitHub ↗

Transforms a baseline (in world coords) into a 2d box (in sensor coords) Args: baseline ([type]): [description] cam ([type]): [description] height (int, optional): Box height. Defaults to 1. Returns: [type]: Box in sensor coords

(self, baseline, cam, height=1)

Source from the content-addressed store, hash-verified

600 return baseline
601
602 def _baseline_to_box(self, baseline, cam, height=1):
603 """Transforms a baseline (in world coords) into a 2d box (in sensor coords)
604
605 Args:
606 baseline ([type]): [description]
607 cam ([type]): [description]
608 height (int, optional): Box height. Defaults to 1.
609
610 Returns:
611 [type]: Box in sensor coords
612 """
613 cords_x_y_z = np.array(self._world_to_sensor(baseline, self._get_sensor_position(cam))[:3, :])
614
615 cords = np.hstack((cords_x_y_z, np.fliplr(cords_x_y_z + np.array([[0],[0],[height]]))))
616
617 return self._coords_to_2d_bb(cords)
618
619
620 def _coords_to_2d_bb(self, cords):

Callers 1

_get_2d_bbsMethod · 0.95

Calls 3

_world_to_sensorMethod · 0.95
_get_sensor_positionMethod · 0.95
_coords_to_2d_bbMethod · 0.95

Tested by

no test coverage detected