Carla: error occured when enable lidar publication for carla_ros_bridge

Created on 13 Jul 2018  路  13Comments  路  Source: carla-simulator/carla

Hi,
I am trying to enable lidar publication and uncomment those lines in setting.yaml but i got error.
Error message:

Traceback (most recent call last):
  File "/home/ubuntu/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/client.py", line 34, in <module>
    main()
  File "/home/ubuntu/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/client.py", line 30, in main
    carla_ros_bridge.run()
  File "/home/ubuntu/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/bridge.py", line 156, in run
    self.sensors[name].process_sensor_data(data, self.cur_time)
  File "/home/ubuntu/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/sensors.py", line 59, in process_sensor_data
    self._compute_transform(data, cur_time)
  File "/home/ubuntu/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/sensors.py", line 107, in _compute_transform
    t.header.stamp = self.cur_time
AttributeError: 'LidarHandler' object has no attribute 'cur_time'
[INFO] [1531471478.126028]: Shutdown requested
[carla_ros_bridge-2] process has died [pid 15009, exit code 1, cmd /home/ubuntu/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/client.py __name:=carla_ros_bridge __log:=/home/ubuntu/.ros/log/f74e5d78-8678-11e8-95c8-d050992713c6/carla_ros_bridge-2.log].
log file: /home/ubuntu/.ros/log/f74e5d78-8678-11e8-95c8-d050992713c6/carla_ros_bridge-2*.log

Everything runs well when i didn't do the uncomment
Can anyone help me? Thanks a lot!

support

Most helpful comment

@wolfsubak
I've just tested it. It works when I'm using binary files from release 0.8.4, carla-ros-bridge and PythonClient form master branch. Make sure that you have updated PythonClient and protobuf library as described in the documentation.

All 13 comments

Hi @lxtttt. Try to use latest code from the master branch. It was already fixed.

Hi @lxtttt.
Close the issue if @danil-tolkachev's answer works for you :)

The fix is not available on the 0.8.4 branch and ros is not supported yet on 0.9.0 is there a way to solve this issue ?

@wolfsubak
Latest binary files from version 0.8.4 and python code from the master branch (PythonClient and carla_ros_bridge) should work.

@nsubiron
Could you clarify the future of 0.8.x branch? Are there any plans to 0.8.5 version? Will the stable branch always point to 0.8.2 or will it shift to later versions?

PythonClient works fine
carla_ros_bridge as well, except when, as @lxtttt , activate lidar by editing setting.yaml.
by activating lidar I get same python issue:

[INFO] [1534922483.559353, 0.000000]: Exiting Bridge
Traceback (most recent call last):
  File "/home/wolf/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/client.py", line 34, in <module>
    main()
  File "/home/wolf/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/client.py", line 30, in main
    carla_ros_bridge.run()
  File "/home/wolf/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/bridge.py", line 156, in run
    self.sensors[name].process_sensor_data(data, self.cur_time)
  File "/home/wolf/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/sensors.py", line 59, in process_sensor_data
    self._compute_transform(data, cur_time)
  File "/home/wolf/ros/catkin_ws_for_carla/src/carla_ros_bridge/src/carla_ros_bridge/sensors.py", line 107, in _compute_transform
    t.header.stamp = self.cur_time
AttributeError: 'LidarHandler' object has no attribute 'cur_time'
[INFO] [1534922483.686059, 0.000000]: Shutdown requested

@danil-tolkachev

Could you clarify the future of 0.8.x branch? Are there any plans to 0.8.5 version? Will the stable branch always point to 0.8.2 or will it shift to later versions?

I don't think there will be any more 0.8.x versions, unless we have some very important fix before 0.9.x is stable. We simply don't have enough people for maintaining two versions of the API, so all our effort will go to make 0.9.x stable and migrate everything to it during the next months. The idea is that the next "stable" version will work already with the new API.

I know it's going to be chaotic for a while having these two versions coexisting, specially having the ROS bridge on master not compatible with master branch of Carla. Now my effort will go to add to the new API all the measurements that are missing (Lidar, bounding boxes, etc) so we have a fully functional Carla and we can migrate the ROS bridge to the new API. I opened a ROS channel in our Discord server so we can discuss ROS things there too https://discord.gg/JU8Bjc8 (btw this link is permanent, you can add it to docs etc).

Let me know too what are the top necessary things in the API for the ROS bridge, also if you have cool ideas for new functionality :)

@wolfsubak
You are using the old ros-bridge. You should replace it with the code from the master branch.

@nsubiron
Thanks for the detailed answer. I'll think about possible features in the API.

@danil-tolkachev oh perfect, understood. It was a little bit confusing between using stable carla and master ros bridge.
It works perfectly on 83070b8c8f9cde1257b4ed6c467e7a2ee3c2f14d but not on master: an error is occuring since last commit.

@wolfsubak
I've just tested it. It works when I'm using binary files from release 0.8.4, carla-ros-bridge and PythonClient form master branch. Make sure that you have updated PythonClient and protobuf library as described in the documentation.

@danil-tolkachev
Hi.I follow your method,running as follows:rostest carla_ros_bridge ros_bridge_client.test. it appear a error:
IOError: [Errno 2] No such file or directory: u'/home/rcj_robot/carla/PythonClient/carla/planner/.txt' [Testcase: testtestTopics] ... ERROR!
so What should I do?

Hi @chengjinjack
I'm not sure. Sometimes test runs with warnings on my machine. But I've never seen your error. Have you checked the ros-bridge with bundled launch files?

And the traditional question:
Did you check that you are using PythonClient and carla_ros_bridge from master branch with binary files from release 0.8.4?

@danil-tolkachev
Thanks.The issue has been solved!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tgrel picture tgrel  路  3Comments

phzeller picture phzeller  路  3Comments

hc167 picture hc167  路  4Comments

cstamatiadis picture cstamatiadis  路  3Comments

qixiaoshuai0120 picture qixiaoshuai0120  路  3Comments