carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.58k stars 3.73k forks source link

Geolocation to world coordinates #1848

Open muety opened 5 years ago

muety commented 5 years ago

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?

nsubiron commented 5 years ago

Sadly that's not implemented.

muety commented 5 years ago

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

germanros1987 commented 4 years ago

@Axel1092 0.9.11 task?

jht1759 commented 4 years ago

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 commented 4 years ago

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

muety commented 4 years ago

@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.

Axel1092 commented 4 years ago

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.

rhklite commented 3 years ago

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?

werewolfdev commented 3 years ago

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

k-nayak commented 2 years ago

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.

Sultan91 commented 1 year ago

@Axel1092 Hi, was this feature already implemented?

minhaj6 commented 4 months ago

any update on this issue?