Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map.get_waypoint/3 doesn't work for carla.LaneType.Sidewalk #1641

Closed
d0m3k opened this issue May 14, 2019 · 3 comments
Closed

Map.get_waypoint/3 doesn't work for carla.LaneType.Sidewalk #1641

d0m3k opened this issue May 14, 2019 · 3 comments
Assignees
Labels

Comments

@d0m3k
Copy link

d0m3k commented May 14, 2019

Using CARLA 0.9.5 on Ubuntu 16.04, on map Town05:

I have an issue regarding usage of new Waypoint API with points of types other than carla.LaneType.Driving, specifically carla.LaneType.Sidewalk.

It seems that, while since 0.9.5 there is version of Map.get_waypoint with parameter lane_type, when project_to_road is set to False and type other than Driving is chosen, it always returns None instead of waypoint, effectively blocking from fetching paths for walkers.
(See PythonAPI/examples/pedestrian_automatic.py and related PythonAPI/carla/agents/navigation/pedestrian_agent.py on branch pedestrian-walking in my fork).

Is this lack of implementation, or my misuse? I see that OpenDrive xodr files of built-in maps have information on sidewalks which is parsed by Carla, yet both Map.get_topology [1] and Map.get_waypoint methods seem to omit them completely.

[1] -- on provided pedestrian-walking branch there is a slightly modified version of Map.cpp, which includes sidewalks in topology -- there is still no possibility to fetch any sidewalk-based waypoint.

@d0m3k d0m3k changed the title Map.get_waypoint/3 Map.get_waypoint/3 doesn't work for carla.LaneType.Sidewalk May 14, 2019
@marcgpuig
Copy link
Contributor

Hi @d0m3k

project_to_road=False is used to determine if a location, where you asked for a waypoint, is inside the lane (road lane, sidewalk, shoulder...) of the nearest waypoint (of the type lane_type), if the location is outside the lane, the result of this waypoint is None. This is useful, for instance, if you want to know if your car is inside the road.
Could be, that you get None because these locations that you are asking, they are not inside the lane itself?

@d0m3k
Copy link
Author

d0m3k commented May 27, 2019

My case was using pedestrians spawned on spawn points dedicated for cars, so, if it should return None when no Sidewalk-type waypoint is available in close proximity, what you describe is valid; the script asks for waypoint based on current pedestrian location (and that would fail, for it's walking in the middle of road dedicated for cars).

So if I understand correctly, project_to_road set to True should try to find the closest path available on the lane of required type? Because from what I saw during my tests, whatever value I set as lane_type, when project_to_road=True, waypoints were exactly the same as for Driving lane, at least on 0.9.5 on Town05. (I'll try it again to be sure I'm not doing anything stupid when project rebuilds confirmed for Town02 and Town05).

@d0m3k
Copy link
Author

d0m3k commented May 28, 2019

UPDATE #2: There must be an error in my implementation, because I just modified lane_explorer.py and successfully rendered data on sidewalks; there are no junctions between sidewalks for them, though.
Lemme close it for time of rewrite; thank you for your help!

@d0m3k d0m3k closed this as completed May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants