dynamic_robot_localization icon indicating copy to clipboard operation
dynamic_robot_localization copied to clipboard

Node doesn't start due to invalid time?

Open jncfa opened this issue 4 years ago • 1 comments

Hi,

I'm trying to use your package for a SLAM project, but I'm running into a weird issue when launching the localization node. The drl_localization_node starts up but remains stuck in a loop, posting the message "Waiting for valid time...", which corresponds to this loop:

Screenshot from 2021-03-10 23-24-45

Have you ever run into this problem before? If so, could you be so kind as to provide some information in order to solve it?

Thanks!

jncfa avatar Mar 10 '21 23:03 jncfa

Hello,

That happens when drl is waiting for valid time or waiting for a valid map / reference point cloud. The reason for that part of the code was to allow the loading of the map / occupancy grid (in the message handler) while a rosbag is paused (and that way, allowing drl to be ready to process the sensor data when you start playing the rosbag).

If you did not set the parameter use_sim_time to true and do not have a rosbag paused, then drl is waiting for a valid map in the configured topics. http://wiki.ros.org/Clock

You can provide the map in a .ply file:

  • https://github.com/carlosmccosta/dynamic_robot_localization/blob/noetic-devel/launch/dynamic_robot_localization_system.launch#L32

Or from an OccupancyGrid / PointCloud2 ros message:

  • https://github.com/carlosmccosta/dynamic_robot_localization/blob/noetic-devel/launch/dynamic_robot_localization_system.launch#L45
  • https://github.com/carlosmccosta/dynamic_robot_localization/blob/noetic-devel/launch/dynamic_robot_localization_system.launch#L47

For publishing a OccupancyGrid you can use map_server: http://wiki.ros.org/map_server

For publishing PointCloud2 you can use point_cloud_io: https://github.com/carlosmccosta/point_cloud_io#read

For avoiding confusion, I made the message clearer with the last commit: https://github.com/carlosmccosta/dynamic_robot_localization/commit/72b1ba3f78cff6311f5ae51e83dca9597ddcb2b7

Have a nice day,

carlosmccosta avatar Mar 15 '21 23:03 carlosmccosta