Problem with subscriber within costmap layer
Hi all,
A question for those familiar with the Creating a New Layer (in costmap_2d/Tutorials) tutorial
I got stuck with this problem: I want to define a custom layer to extend a costmap_2d::Layer
which contains a subscriber
to retrieve some infomation from an external publisher node.
Following the tutorial I created the SimpleLayer
class (see paragraph
2). Then I added to the class SimpleLayer
the private member ros::Subscriber sub_
and a callback function (as a private method). To initialize the subscriber I added the following line to SimpleLayer::OnInitialize()
right before the assignment of the dynamic_reconfigure server:
sub_ = nh.subscribe("the_published_topic", 1000, &SimpleLayer::MyCallbackFunction, this);
where SimpleLayer::MyCallbackFunction
should print on screen the message published by the_published_topic
. The plugin is
correctly installed and launching move_base
it is alse loaded, anyway it seems that SimpleLayer::MyCallbackFunction
is
not called during the execution (output is already set to screen).
I Hope not to be too detailed.
Regards, Federico