1. topic types 不匹配
使用 roslaunch
命令
roslaunch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle.launch
启动官方 demo 后,试图通过手写 Python
脚本来控制车辆,但是有下面报错:
Could not process inbound connection: topic types do not match:
[carla_msgs/CarlaEgoVehicleControl] vs. [topic_demo/CarlaEgoVehicleControl]
很明显 topic
类型不匹配,我们需要给 carla_msgs/CarlaEgoVehicleControl
发送控制命令,那么我们的 topic
也应该是 carla_msgs
。
解决方法:
- 在
~/catkin_ws
目录下重新创建carla_msgs
文件夹后再重新执行catkin_make
命令
2. topic datatype/md5sum 不一致
问题 1 解决后又有如下报错
Could not process inbound connection: Client [/carla_ros_bridge]
wants topic [/carla/ego_vehicle/vehicle_control_cmd] to have datatype/md5sum
[carla_msgs/CarlaEgoVehicleControl/e5b57fc698c12ff4c20a5fc71fba832f],
but our version has [carla_msgs/CarlaEgoVehicleControl/919d1c0732720a839958ff82b9ba0dcd]
Dropping connection.
是因为我们修改了该 topic
对应的 msg
或者 srv
文件,导致两者的 MD5
值不一致。
解决方法:
- 将原始的
msg
或者srv
文件拷贝过来放到自己当前Python
项目的package
目录下,然后重新执行catkin_make
。
3. message/service xxx have changed. Please rerun cmake.
问题 1 和 2 解决后接着执行 catkin_make
命令时又报错:
The dependencies of the message/service 'carla_msgs/CarlaEgoVehicleControl' have changed. Please rerun cmake.
carla_msgs/CMakeFiles/_carla_msgs_generate_messages_check_deps_CarlaEgoVehicleControl.dir/build.make:57:
recipe for target 'carla_msgs/CMakeFiles/_carla_msgs_generate_messages_check_deps_CarlaEgoVehicleControl' failed
很明显由于 CarlaEgoVehicleControl.msg
文件改动后导致需要重新 cmake
。
解决方法:
- 删除工作空间
~/catkin_ws
中devel
和build
目录下对应的项目目录文件,比如我的目录carla_msgs
。(build
目录下包含include
和lib
目录)
参考:https://answers.ros.org/question/138731/catkin_make-clean/