I noticed that the localization nodelet frequently does not receive the point cloud map from the global map server when launching hdl_localization.launch. I did some testing and realized that both initializing the ros::Publisher and publishing the map message in the onInit() method causes the publisher to not have enough time to start up and the message is lost.
I tried fixing this with a normal delay with sleep(), and with ros::Duration().sleep(), but the way the threading works in the nodelet prevented that from being successful. I settled on a oneshot ros::WallTimer to provide the delay, which is what you see in this PR.
The localization node receives the global map message every time now.
I noticed that the localization nodelet frequently does not receive the point cloud map from the global map server when launching
hdl_localization.launch
. I did some testing and realized that both initializing theros::Publisher
and publishing the map message in theonInit()
method causes the publisher to not have enough time to start up and the message is lost.I tried fixing this with a normal delay with
sleep()
, and withros::Duration().sleep()
, but the way the threading works in the nodelet prevented that from being successful. I settled on a oneshotros::WallTimer
to provide the delay, which is what you see in this PR.The localization node receives the global map message every time now.