MCPcopy Create free account
hub / github.com/Thinklab-SJTU/Bench2Drive / get_forward_vector

Function get_forward_vector

tools/utils.py:44–53  ·  view source on GitHub ↗
(yaw)

Source from the content-addressed store, hash-verified

42 return False
43
44def get_forward_vector(yaw):
45 # Convert the yaw angle from degrees to radians
46 yaw_rad = math.radians(yaw)
47 # Calculate the X and Y components of the forward vector (in a left-handed coordinate system with Z-axis upwards)
48 # Note: In a left-handed coordinate system, the positive Y direction could correspond to either forward or backward, depending on the specific application scenario
49 x = math.cos(yaw_rad)
50 y = math.sin(yaw_rad)
51 # On a horizontal plane, the Z component of the forward vector is 0
52 z = 0
53 return np.array([x, y, z])
54
55def calculate_cube_vertices(center, extent):
56 if isinstance(center, list):

Callers 1

visualize_dataFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected