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

Method _trig_to_world

leaderboard/team_code/base_agent.py:701–717  ·  view source on GitHub ↗

Transforms the trigger coordinates to world coordinates Args: bb ([type]): [description] parent ([type]): [description] trigger ([type]): [description] Returns: [type]: [description]

(self, bb, parent, trigger)

Source from the content-addressed store, hash-verified

699
700
701 def _trig_to_world(self, bb, parent, trigger):
702 """Transforms the trigger coordinates to world coordinates
703
704 Args:
705 bb ([type]): [description]
706 parent ([type]): [description]
707 trigger ([type]): [description]
708
709 Returns:
710 [type]: [description]
711 """
712 bb_transform = carla.Transform(trigger.location)
713 bb_vehicle_matrix = self.get_matrix(bb_transform)
714 vehicle_world_matrix = self.get_matrix(parent.get_transform())
715 bb_world_matrix = vehicle_world_matrix @ bb_vehicle_matrix
716 world_cords = bb_world_matrix @ bb.T
717 return world_cords
718
719 def _create_2d_bb_points(self, actor_bb, scale_factor=1):
720 """

Callers 2

_get_2d_bb_baselineMethod · 0.95
_change_seg_stopMethod · 0.95

Calls 2

get_matrixMethod · 0.95
get_transformMethod · 0.80

Tested by

no test coverage detected