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

Method _create_2d_bb_points

leaderboard/team_code/base_agent.py:719–733  ·  view source on GitHub ↗

Returns 2D floor bounding box for an actor.

(self, actor_bb, scale_factor=1)

Source from the content-addressed store, hash-verified

717 return world_cords
718
719 def _create_2d_bb_points(self, actor_bb, scale_factor=1):
720 """
721 Returns 2D floor bounding box for an actor.
722 """
723
724 cords = np.zeros((4, 4))
725 extent = actor_bb.extent
726 x = extent.x * scale_factor
727 y = extent.y * scale_factor
728 z = extent.z * scale_factor
729 cords[0, :] = np.array([x, y, 0, 1])
730 cords[1, :] = np.array([-x, y, 0, 1])
731 cords[2, :] = np.array([-x, -y, 0, 1])
732 cords[3, :] = np.array([x, -y, 0, 1])
733 return cords
734
735 def _get_sensor_position(self, cam):
736 """returns the sensor position and rotation

Callers 2

_get_2d_bb_baselineMethod · 0.95
_change_seg_stopMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected