GMahmoud/virtual_costmap_layer

i had not found ros::spin() in your code.

Closed this issue · 1 comments

Hello I got my inspiration from you,so i try to write a plugin.
I wrote

ros::Subscriber line_sub;
line_sub = nh.subscribe("line_layer", 100, LineCallback);

in the function onInitialize();
if i do not write ros::spin() ,it does not work;
but i had not found ros::spin() in your code.
so please tell me the reason, thanks.

okay, I finally figure out why it doesn't work. The default NodeHandle in costmap is a private nh(start with "~/"), which means the topic you subscribe/publish will have a prefix : /node_name/nh_name/your_topic_name
If you want to subscribe to "line_layer", the topic name should be "/line_layer"