Open gunnxx opened 1 year ago
Only if folks who build ROS and CARLA knew graphics, we wouldn't have to do these conversions.
Correct transforms should be like this in transforms.py as mentioned by @gunnxx
RHS (ROS) = LHS (CARLA)
Position:
x_ros = x_carla
y_ros = -y_carla
z_ros = z_carla
Rotation:
roll_ros = -roll_carla
pitch_ros = pitch_carla
yaw_ros = -yaw_carla
@UditSinghParihar you also have to change the default config to spawn ego if you use that one (here). You have to negate the pitch. This is very very inconvenient.
@gunnxx , thanks for the pointer but moving forward I have just changed the tranforms.py and the changes in the objects.json
would only be in the right-hand coordinate transform.
Hi, I noticed that in carla_rotation_to_RPY function, yaw and pitch are inverted. If CARLA uses left-hand coordinate system (with z-axis up) and ROS uses right-hand coordinate system (with z-axis up), then yaw and roll should be the ones inverted. See figure below.![Screenshot from 2022-09-05 15-55-56](https://user-images.githubusercontent.com/31506965/188383785-66eb9957-8983-434e-959f-2d2ce355099f.png)
I do not know if there is another rule that I missed, because CARLA documentation itself is kind of inconsistent. In the carla.Rotation documentation, the picture shows that the yaw is left-handed but roll and pitch are right-handed.