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

Method _get_angle_to

leaderboard/team_code/auto_pilot.py:119–129  ·  view source on GitHub ↗
(self, pos, theta, target)

Source from the content-addressed store, hash-verified

117 self._affected_by_stop = False # if the ego vehicle is influenced by a stop sign
118
119 def _get_angle_to(self, pos, theta, target):
120 R = np.array([
121 [np.cos(theta), -np.sin(theta)],
122 [np.sin(theta), np.cos(theta)],
123 ])
124
125 aim = R.T.dot(target - pos)
126 angle = -np.degrees(np.arctan2(-aim[1], aim[0]))
127 angle = 0.0 if np.isnan(angle) else angle
128
129 return angle
130
131 def _get_control(self, target, far_target, tick_data):
132 pos = self._get_position(tick_data)

Callers 1

_get_controlMethod · 0.95

Calls 1

dotMethod · 0.80

Tested by

no test coverage detected