Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello Vincenz,

I suggest you use connect, with SIGNAL and SLOT. here is a part of my code.

In constructor :

QPushButton* stop_button = new QPushButton(QObject::trUtf8("Stop"));

connect(stop_button, SIGNAL(clicked()), this, SLOT(stopCallback()));

nav_stop_pub_ = nh_.advertise<actionlib_msgs::GoalID>("/move_base/cancel", 1, true);

and then declare stopCallback():

void YourClassName::stopCallback(){
    actionlib_msgs::GoalID stop_msg;
    nav_stop_pub_.publish(stop_msg);
}

Hope there can help you, bset wish.