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

Method rotate_point

agents/navigation/agent.py:114–121  ·  view source on GitHub ↗

rotate a given point by a given angle

(point, radians)

Source from the content-addressed store, hash-verified

112 Calculates the yaw of the waypoint that represents the trigger volume of the traffic light
113 """
114 def rotate_point(point, radians):
115 """
116 rotate a given point by a given angle
117 """
118 rotated_x = math.cos(radians) * point.x - math.sin(radians) * point.y
119 rotated_y = math.sin(radians) * point.x - math.cos(radians) * point.y
120
121 return carla.Vector3D(rotated_x, rotated_y, point.z)
122
123 base_transform = traffic_light.get_transform()
124 base_rot = base_transform.rotation.yaw

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected