carla-simulator / ros-bridge

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

Sensors synchronization Problem with /carla/objects #533

Closed Roosstef closed 3 years ago

Roosstef commented 3 years ago

Hey all,

I noticed a possible problem with the syncronization between sensor data and /carla/objects.

My setup:

In my example I start the ros_bridge with 2 radar sensors , "sensor.pseudo.tf", "sensor.pseudo.objects" and "sensor.pseudo.markers".
I use a simple script to print the two topics of the sensors and the /carla/objects

In the attached file there are different timestamps between the sensor data and the /carla/objects associated with header.seq

Carla_issue

In previous Carla version 0.9.10.1 the same script causes no issues.

Roosstef commented 3 years ago

Does anyone else have this problem? Does anyone have any idea if this is a carla or rosbridge problem?

joel-mb commented 3 years ago

Hi @Roosstef. Sorry for the delay. I think this is definitely a bug in the ROS bridge side. It seems that there is a race condition between the publication of the clock data and the generation of the header for some sensors. I've pushed some changes in https://github.com/carla-simulator/ros-bridge/tree/joel-mb/fix_timestamp that should solve the synchronization problem. Could you verify that it solves the issue for your use case?

Roosstef commented 3 years ago

@joel-mb your solution fixed the issue. Thank you!

Roosstef commented 3 years ago

Hey all,

i think the same or similar issue appears again in master dac9e72 with carla 0.9.12

My setup:

Ubuntu 20.04 Ros noetic Carla 0.9.11 Ros bridge master (dac9e72)

Screenshot from 2021-10-13 15-06-58

sequence numbers dont match time stamps for carla/objects (gt) and /carla/ego_vehicle/lidar0 (pc)

@joel-mb do you think we should reopen this issue?