cyberbotics / webots

Webots Robot Simulator
https://cyberbotics.com
Apache License 2.0
3.19k stars 1.67k forks source link

The local Cartesian coordinates do not match #6393

Open xinxing-max opened 11 months ago

xinxing-max commented 11 months ago

Describe the Bug In webots, I set the coordinate system to wgs84 and gave the reference wgs84 coordinates, and published the GPS information of Tesla cars through ros2. After subscribing the gps information, I converted the wgs84 coordinates to local cartesian coordinates. It was found that the calculated coordinates were inconsistent with the local Cartesian coordinates displayed in webots.

I have used geographiclib for conversion, or calculated through trigonometric functions through the difference in longitude and latitude between the current coordiantes and the reference coordiantes. The results calculated by both of them are the same, but there is an error with the coordinates in webots.

Expected behavior The calculated coordinates should be same as the coordinates shown in webots.

System

sairaghavamunagala2001 commented 4 months ago

I am running crazyfile [https://github.com/ArduPilot/ardupilot/blob/master/libraries/SITL/examples/Webots_Python/worlds/crazyflie.wbt] , the co-ordinate of drone and co-ordinate i am getting in webots is different i am not getting same co-ordinates.

The original co-ordinates of drone from the drone i am getting as follows: lat : -353635796, lon : 1491635943, The co-ordinates i am getting from the webots side is as follows: lat: -35.36330672369665, lon: 149.16498635683504