Spawning agents in carla sumo co-simulation #8272
Unanswered
nikolatopic131
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello. I'm working on a co-simulation. I have a custom map made in Roadrunner and imported into Carla as per the instructions (make import). I am now trying to implement the agents given by carla developers (basic agent for start, will change later if I can get it to work) into my co-simulation. However I am running into a problem.
I made a small script to test out the spawning of the agents just in carla (code in picture 1), and when I run this script with just carla running it works fine and the agent drives to its destination. But, when I try to put the code for spawning agents into the run_synchronization.py (picture 2) script which is the script for running the co-simulation given by carla developers, I get the following error:
Traceback (most recent call last):
File "run_synchronization_modified.py", line 504, in
synchronization_loop(arguments)
File "run_synchronization_modified.py", line 371, in synchronization_loop
agent.set_destination(destination)
File "C:\carla\PythonAPI\carla\agents\navigation\basic_agent.py", line 161, in set_destination
route_trace = self.trace_route(start_waypoint, end_waypoint)
File "C:\carla\PythonAPI\carla\agents\navigation\basic_agent.py", line 187, in trace_route
return self._global_planner.trace_route(start_location, end_location)
File "C:\carla\PythonAPI\carla\agents\navigation\global_route_planner.py", line 47, in trace_route
route = self._path_search(origin, destination)
File "C:\carla\PythonAPI\carla\agents\navigation\global_route_planner.py", line 298, in _path_search
route = nx.astar_path(
File "C:\Users\Nikola\AppData\Local\Programs\Python\Python38\lib\site-packages\networkx\algorithms\shortest_paths\astar.py", line 155, in astar_path
raise nx.NetworkXNoPath(f"Node {target} not reachable from {source}")
networkx.exception.NetworkXNoPath: Node 391 not reachable from 449
Now, the reason I am confused is because in my small av_test.py script I give the agent the exact same route as in the run_synchronization,py script and I don't get any error. It is worth mentioning that I built the SUMO net first, then imported it into Roadrunner and then into Carla. Additionally, I did edit the Route planners in Unreal Engine in my map because they weren't spawned automatically for my two on-ramps, but I tried to generate a new SUMO net from that edited opendrive and run the synchronization with the new net, and still got the same error, so I'm led to believe that my map isn't an issue.
If someone could share some wisdom I'd be very grateful, as this issue is confusing me very much.
Beta Was this translation helpful? Give feedback.
All reactions