Hi everyone,
I tried to establish a subscriber in [move_action_capability](http://moveit.ros.org/groovy/doxygen/move__action__capability_8cpp_source.html#L140) in Moveit!
I established the subscriber within method "move_group::MoveGroupMoveAction::executeMoveCallback_PlanOnly" and following is my code to establish the subscriber:
ros::NodeHandle handle;
ros::Subscriber sub = handle.subscribe("r_arm_controller/state", 1000, controllerStateCB);
This is my callback signature:
void controllerStateCB(const pr2_controllers_msgs::JointTrajectoryControllerState::ConstPtr& msg)
{
for (int joint_index = 0; joint_index < 7; joint_index++)
{
current_joint_position[joint_index]=msg->actual.positions[joint_index];
current_joint_velocity[joint_index]=msg->actual.velocities[joint_index];
}
}
However, when I compile, I got the following error:
/home/pr2/moveit/src/moveit_ros/move_group/src/default_capabilities/move_action_capability.cpp: In member function ‘void move_group::MoveGroupMoveAction::executeMoveCallback_PlanOnly(const MoveGroupGoalConstPtr&, moveit_msgs::MoveGroupResult&)’:
/home/pr2/moveit/src/moveit_ros/move_group/src/default_capabilities/move_action_capability.cpp:203:91: error: no matching function for call to ‘ros::NodeHandle::subscribe(const char [23], int, )’
/home/pr2/moveit/src/moveit_ros/move_group/src/default_capabilities/move_action_capability.cpp:203:91: note: candidates are:
/opt/ros/groovy/include/ros/node_handle.h:379:14: note: template ros::Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, void (T::*)(M), T*, const ros::TransportHints&)
/opt/ros/groovy/include/ros/node_handle.h:390:14: note: template ros::Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, void (T::*)(M)const, T*, const ros::TransportHints&)
/opt/ros/groovy/include/ros/node_handle.h:438:14: note: template ros::Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, void (T::*)(const boost::shared_ptr&), T*, const ros::TransportHints&)
/opt/ros/groovy/include/ros/node_handle.h:448:14: note: template ros::Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, void (T::*)(const boost::shared_ptr&)const, T*, const ros::TransportHints&)
/opt/ros/groovy/include/ros/node_handle.h:498:14: note: template ros::Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, void (T::*)(M), const boost::shared_ptr&, const ros::TransportHints&)
/opt/ros/groovy/include/ros/node_handle.h:509:14: note: template ros::Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, void (T::*)(M)const, const boost::shared_ptr&, const ros::TransportHints&)
/opt/ros/groovy/include/ros/node_handle.h:559:14: note: template ros::Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, void (T::*)(const boost::shared_ptr&), const boost::shared_ptr&, const ros::TransportHints&)
/opt/ros/groovy/include/ros/node_handle.h:570:14: note: template ros::Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, void (T::*)(const boost::shared_ptr&)const, const boost::shared_ptr&, const ros::TransportHints&)
/opt/ros/groovy/include/ros/node_handle.h:618:14: note: template ros::Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, void (*)(M), const ros::TransportHints&)
/opt/ros/groovy/include/ros/node_handle.h:663:14: note: template ros::Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, void (*)(const boost::shared_ptr&), const ros::TransportHints&)
/opt/ros/groovy/include/ros/node_handle.h:706:14: note: template ros::Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, const boost::function&)>&, const VoidConstPtr&, const ros::TransportHints&)
/opt/ros/groovy/include/ros/node_handle.h:752:14: note: template ros::Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, const boost::function&, const VoidConstPtr&, const ros::TransportHints&)
/opt/ros/groovy/include/ros/node_handle.h:785:14: note: ros::Subscriber ros::NodeHandle::subscribe(ros::SubscribeOptions&)
/opt/ros/groovy/include/ros/node_handle.h:785:14: note: candidate expects 1 argument, 3 provided
I have no idea what's wrong with my code to establish the subscriber.
Thanks for any help in advance!
↧