carla icon indicating copy to clipboard operation
carla copied to clipboard

Geolocation to world coordinates

Open muety opened this issue 6 years ago • 12 comments

While the Python API offers carla.Map.transform_to_geolocation(), I couldn't find a method to do a conversion the other way round. How can I achieve that?

muety avatar Jul 04 '19 15:07 muety

Sadly that's not implemented.

nsubiron avatar Jul 05 '19 11:07 nsubiron

I'd appreciate if someone could implement that! I guess is not too big of a change and would help me a lot!

muety avatar Jul 05 '19 15:07 muety

@Axel1092 0.9.11 task?

germanros1987 avatar Jun 26 '20 03:06 germanros1987

Hello Gentle: @germanros1987

I'd like to know. before the official version 0.9.11 release for this issue. how can we do some script for it by ourself. and then we can solve the issue temporary.

Thanks a lot!

jht1759 avatar Aug 19 '20 01:08 jht1759

@muety : Do you have any idea to solve the issue you request? Thanks a lot!

jht1759 avatar Aug 19 '20 01:08 jht1759

@jht1759 There has to be some kind of linear mapping from world coordinates to GNSS coordinates, i.e. vectors A and B, such that P_world = P_gnss * A + B. However, I don't know how to find those factors in Carla's code base. To be honest, to approximately solve my problem, I sampled a few thousand (P_world, P_gnss) pairs and then did a regression to find out their relationship (i.e A and B), but that's not recommendable as it's not exact and a very ugly hack.

muety avatar Aug 19 '20 06:08 muety

Hi all, we will implement this feature for 0.9.11. In the mean time, you could search on how to perform the projections from geolocation coordinates to the plane X,Y for instance using the mercator projection. There is also the proj library (https://proj.org/) which has a number of projections from geolocation.

Axel1092 avatar Aug 26 '20 08:08 Axel1092

I'm having trouble with this aswell. I tried using the python utm package: utm.from_latlon(), but the result does not match up with the map imported from OSM. Can anyone provide some information on how the (0,0) position in carla is selected when the .xodr file is imported?

rhklite avatar Dec 11 '20 04:12 rhklite

Hi @Axel1092 geolocation to ENU is still not implemented right in CARLA

werewolfdev avatar Oct 20 '21 13:10 werewolfdev

Hello, all I have been digging the forum for a while and I feel like this discussion has been the closest till now. I would like to get the XY map coordinates of a map (Town07 in my case) by using pixel coordinates from the camera. I am using a lane detection model and want to generate a trajectory by getting the XY coordinates of the map using the detected pixel locations on the road. And I want to know if anyone can guide me in the right direction of how that can be achieved or if it is still a work in progress. I am using Carla 0.9.11. Any feedback would be of great help. Thanks a lot.

k-nayak avatar Jun 01 '22 11:06 k-nayak

@Axel1092 Hi, was this feature already implemented?

Sultan91 avatar Sep 21 '23 07:09 Sultan91

any update on this issue?

minhaj6 avatar Jul 26 '24 19:07 minhaj6

This is gonna be achieved for 0.9.16

Blyron avatar Aug 07 '25 08:08 Blyron