carla-simulator / ros-bridge

ROS bridge for CARLA Simulator
MIT License
531 stars 441 forks source link

Error when running carla_ad_demo: TypeError: __init__() takes exactly 3 arguments (2 given) #532

Open dimmo90 opened 3 years ago

dimmo90 commented 3 years ago

HI all,

I am trying to run the carla_ad_demo file. I have followed the instructions on the README of carla_ad_demo and can successfully launch it in an rviz window with a car being spawned. However, when I click to execute the scenario (FollowLeadingVehicle), I get the following error:


[INFO] [1619541221.038465, 38.564444]: Status updated to ApplicationStatus.STARTING
[WARN] [1619541221.039914, 38.564444]: [SC]Executing: /usr/bin/python /home/dim/scenario_runner/scenario_runner.py --openscenario /home/dim/carla-ros-bridge/catkin_ws/src/ros-bridge/carla_ad_demo/config/FollowLeadingVehicle.xosc --waitForEgo --timeout 1000000 --host localhost
[INFO] [1619541221.040379, 38.564444]: Calculating route to x=7.09999990463, y=-187.300003052, z=2.0
[ERROR] [1619541221.084839, 38.564444]: bad callback: <bound method CarlaToRosWaypointConverter.on_goal of <__main__.CarlaToRosWaypointConverter object at 0x7f6ea3fdbfd0>>
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/home/dim/carla-ros-bridge/catkin_ws/src/ros-bridge/carla_waypoint_publisher/src/carla_waypoint_publisher/carla_waypoint_publisher.py", line 157, in on_goal
    self.reroute()
  File "/home/dim/carla-ros-bridge/catkin_ws/src/ros-bridge/carla_waypoint_publisher/src/carla_waypoint_publisher/carla_waypoint_publisher.py", line 168, in reroute
    self.current_route = self.calculate_route(self.goal)
  File "/home/dim/carla-ros-bridge/catkin_ws/src/ros-bridge/carla_waypoint_publisher/src/carla_waypoint_publisher/carla_waypoint_publisher.py", line 217, in calculate_route
    dao = GlobalRoutePlannerDAO(self.world.get_map())
TypeError: __init__() takes exactly 3 arguments (2 given)

[WARN] [1619541224.168001, 40.714444]: [SC]Traceback (most recent call last):
  File "/home/dim/scenario_runner/scenario_runner.py", line 593, in <module>
[WARN] [1619541224.169570, 40.714444]: [SC]sys.exit(main())

I've tried to investigate it myself in carla_waypoint_publisher.py but am at a loss as to how I can solve this issue. Would anyone have an idea by any chance?

Ubuntu: 18.04.5 Carla: 0.9.10.1 ROS Melodic Python 2.7 ROS bridge: 0.9.8 Scenario Runner: 0.9.10

joel-mb commented 3 years ago

Hi @dimmo90 , I think that your problem is that you are using incompatible versions. For the ROS bridge you are using 0.9.8 while for CARLA and scenario runner you are using 0.9.10). Please, test with CARLA ROS bridge 0.9.10.1.