lgsvl / simulator

A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Other
2.29k stars 780 forks source link

What is the difference between the coordinates of the simulator and Apollo 3.5? #202

Closed outmanlol closed 5 years ago

outmanlol commented 5 years ago

Hey, LGSVL Teams: As the title says,What is the difference between the coordinates of the simulator and Apollo 3.5? Why is the coordinate X Y Z of the lidar on the unity3d simulation platform different from that of apollo35's lidar? Where can I find their transformation relationship? Looking forward to your reply.

martins-mozeiko commented 5 years ago

In Unity for objects the X axis points right, Y is up and Z forward. In Lidar message we are sending points in coordinate system where X is forward, Y is left and Z is up. This seems to what Apollo and Autoware expects.

outmanlol commented 5 years ago

In Unity for objects the X axis points right, Y is up and Z forward. In Lidar message we are sending points in coordinate system where X is forward, Y is left and Z is up. This seems to what Apollo and Autoware expects. @martins-mozeiko Thinks for your reply. I still have a problem. In Unity the coordinate of Lidar are 0,2.312,-0.3679201,but in apollo35 are 0,0.9807289,2.312. I can't get the correct result by using the coordinate transformation you mentioned. Could you help me? unity_lidar apollo_lidar

martins-mozeiko commented 5 years ago

If I'm not mistaken then this extrinsic is between lidar and imu senors. You need to get position of both lidar and imu, then calculate difference to put here. You cannot simply take absolute value of transform of lidar - that will be relative to (0,0,0) position of car.

outmanlol commented 5 years ago

If I'm not mistaken then this extrinsic is between lidar and imu senors. You need to get position of both lidar and imu, then calculate difference to put here. You cannot simply take absolute value of transform of lidar - that will be relative to (0,0,0) position of car.

@martins-mozeiko Tanks for your reply. I have get the correct result by using the coordinate transformation you mentioned. By the way ,in apollo for objects the X axis points right, Y is forward and Z is up. And I have an another question. In Unity ,the Euler angle of Lidar are 0,0,0,the same with imu,But in apollo35 ,the value of four elements of lidar is not 1,0,0,0.

martins-mozeiko commented 5 years ago

I think 0.707 value for both z and w is 90 degree rotation around vertical axis. I believe for Apollo lidar in normal orientation is looking "to right" not "forwards". That's why it is rotated 90 degrees. In simulator we don't really care about lidar rotation as that is only visual effect.

outmanlol commented 5 years ago

@martins-mozeiko Thinks for your reply. I have figer out it. I just ignored the coordinates of the other sensors themselves.