carlosmccosta / dynamic_robot_localization

Point cloud registration pipeline for robot localization and 3D perception
BSD 3-Clause "New" or "Revised" License
827 stars 197 forks source link

Node doesn't start due to invalid time? #26

Open jncfa opened 3 years ago

jncfa commented 3 years ago

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!

carlosmccosta commented 3 years ago

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:

Or from an OccupancyGrid / PointCloud2 ros message:

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,