ros-bridge icon indicating copy to clipboard operation
ros-bridge copied to clipboard

Issue with IMU orientation?

Open rohanb2018 opened this issue 4 years ago • 3 comments

I noticed that in the IMU file, the IMU orientation calculation doesn't seem to be producing values that are in the standard ROS (right-handed ENU) frame.

The solution that I came up with replaced the following line (which keeps the quaternion in the left-handed CARLA world frame):

quat = tf.transformations.quaternion_from_euler(math.radians(imu_rotation.roll),
                                                        math.radians(imu_rotation.pitch),
                                                        math.radians(imu_rotation.yaw))

with this line, which does the coordinate frame conversion properly (from the left-handed CARLA world frame, to the right-handed ROS ENU frame):

quat = trans.carla_rotation_to_numpy_quaternion(imu_rotation)

Can someone verify that this is actually an issue with the IMU? Is the IMU ROS message supposed to be in the left-handed CARLA world frame?

rohanb2018 avatar Jun 05 '20 19:06 rohanb2018

HI Rohan,

How are you? Did you get a chance to get to the bottom of this issue? I have another issue with Carla IMU data (https://github.com/carla-simulator/carla/issues/2939), which has not received any reply from the Carla team, yet. The IMU gyros data seems to be delivered in the world-frame, instead of the body-frame. On one hand, it seems very unlikely that such a huge bug would go unnoticed, on the other, they've recently fixed a bug which had gravity constantly added to the z-axis accelerometer, disregarding IMU orientation (version 0.9.9.1)... Did you, by any chance, notice anything similar?

Thank you in advance, Gabi Shahmayster

GabiShahmayster avatar Jun 18 '20 20:06 GabiShahmayster

If anyone else comes across this and is wondering about the gyro issue, there is a fix in this PR: https://github.com/carla-simulator/carla/pull/2998

AmeliaEScott avatar Jun 27 '20 11:06 AmeliaEScott

Aren't the angle conversions in transforms.py also incorrect then? Pitch and yaw angles are negated, shouldn't the negation be for roll and yaw instead? Also see this conversion here. @fpasch @ItsTimmy

heethesh avatar Dec 04 '20 08:12 heethesh