MCPcopy Index your code
hub / github.com/OpenDriveLab/DriveAdapter / _get_depth

Method _get_depth

leaderboard/team_code/base_agent.py:866–882  ·  view source on GitHub ↗

Transforms the depth image into meters Args: data ([type]): [description] Returns: [type]: [description]

(self, data)

Source from the content-addressed store, hash-verified

864
865
866 def _get_depth(self, data):
867 """Transforms the depth image into meters
868
869 Args:
870 data ([type]): [description]
871
872 Returns:
873 [type]: [description]
874 """
875
876 data = data.astype(np.float32)
877
878 normalized = np.dot(data, [65536.0, 256.0, 1.0])
879 normalized /= (256 * 256 * 256 - 1)
880 in_meters = 1000 * normalized
881
882 return in_meters
883
884 def _find_obstacle(self, obstacle_type='*traffic_light*'):
885 """Find all actors of a certain type that are close to the vehicle

Callers

nothing calls this directly

Calls 1

dotMethod · 0.80

Tested by

no test coverage detected