-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Description
Is this a bug for calculating yaw?
VAD/tools/data_converter/vad_nuscenes_converter.py
Lines 32 to 38 in 36047b6
| def quart_to_rpy(qua): | |
| x, y, z, w = qua | |
| roll = math.atan2(2 * (w * x + y * z), 1 - 2 * (x * x + y * y)) | |
| pitch = math.asin(2 * (w * y - x * z)) | |
| yaw = math.atan2(2 * (w * z + x * y), 1 - 2 * (z * z + y * y)) | |
| return roll, pitch, yaw | |
The quaternion should be (w, x, y, z). And shouldn't the correct code be:
def quart_to_rpy(qua):
w, x, y, z = qua
roll = math.atan2(2 * (w * x - y * z), 1 - 2 * (x * x + y * y))
pitch = math.asin(2 * (w * y + x * z))
yaw = math.atan2(2 * (w * z - x * y), 1 - 2 * (z * z + y * y))
return roll, pitch, yawpengxuanyang
Metadata
Metadata
Assignees
Labels
No labels