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

Method _get_distance

leaderboard/team_code/base_agent.py:847–863  ·  view source on GitHub ↗

Returns the distance from the (rgb_front) camera to the target Args: target ([type]): [description] Returns: [type]: [description]

(self, target)

Source from the content-addressed store, hash-verified

845 return distance
846
847 def _get_distance(self, target):
848 """Returns the distance from the (rgb_front) camera to the target
849
850 Args:
851 target ([type]): [description]
852
853 Returns:
854 [type]: [description]
855 """
856 sensor_transform = self._sensors['rgb_front'].get_transform()
857
858 distance = np.sqrt(
859 (sensor_transform.location.x - target.x) ** 2 +
860 (sensor_transform.location.y - target.y) ** 2 +
861 (sensor_transform.location.z - target.z) ** 2)
862
863 return distance
864
865
866 def _get_depth(self, data):

Callers 2

_change_seg_stopMethod · 0.95
_change_seg_tlMethod · 0.95

Calls 1

get_transformMethod · 0.80

Tested by

no test coverage detected