About using callbacks [Not solved]
Hello, I made the actionlib
tutorial and I was trying to make my own a simple action handler, but there is an error when I use catkin_make
:
/usr/include/boost/bind/mem_fn_template.hpp:184:7: note: no known conversion for argument 1 from ‘ControlAction*’ to ‘ControlAction&’
make[2]: *** [control/CMakeFiles/control_server.dir/src/control_server.cpp.o] Error 1
make[1]: *** [control/CMakeFiles/control_server.dir/all] Error 2
make: *** [all] Error 2
The code of the action handler is:
#include <ros/ros.h>
#include <geometry_msgs/Twist.h>
#include <actionlib/server/simple_action_server.h>
#include <control/ControlAction.h>
class ControlAction {
protected:
ros::NodeHandle nh_;
actionlib::SimpleActionServer<control::ControlAction> as_;
std::string action_name_;
public:
ControlAction(std::string name):
as_(nh_, name, boost::bind(&ControlAction::executeCB, this, _1), false),
action_name_(name)
{
as_.start();
}
~ControlAction(void)
{
}
void executeCB(const control::ControlGoal &goal) {
}
};
int main(int argc, char** argv) {
ros::init(argc, argv, "control");
ControlAction control(ros::this_node::getName());
ros::spin();
return 0;
}
And i am using the geometry_msgs/Twist
as data type in the .action file.
I am looking forward to use this callback to move the turtlebot, how can i use the cmd_vel
here? (if this were a publisher node_pub.publisher(goal) will be the answer, but there must be another way)
The compilation problem was solved, but stills remaining the other part of the question related about how to use cmd_vel
Thanks beforehand!