ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

[kinetic actionlib]no matching function for call ac.sendGoal(goal);

asked 2017-05-01 06:59:32 -0500

kaijianliu gravatar image

updated 2021-04-24 03:02:18 -0500

miura gravatar image

I use actionlib to control ur3.I write the problem according to the tutorial http://wiki.ros.org/descartes/Tutoria... . The difference is that my server is execute_trajectory. So i change the code in the function of exexutetrajectory as the following :

    bool executeTrajectory(const trajectory_msgs::JointTrajectory& trajectory)
{
  // Create a Follow Joint Trajectory Action Client
  actionlib::SimpleActionClient<moveit_msgs::ExecuteTrajectoryAction> ac("execute_trajectory", true);

  if (!ac.waitForServer(ros::Duration(2.0)))
  {
    ROS_ERROR("Could not connect to action server");
    return false;
  }

  moveit_msgs::ExecuteTrajectoryActionGoal goal;
  //goal.goal.trajectory.joint_trajectory = trajectory;
  //goal.goal_time_tolerance = ros::Duration(1.0);




 ac.sendGoal(goal);

  //if (ac.waitForResult(goal.trajectory.points[goal.trajectory.points.size()-1].time_from_start + ros::Duration(5)))
  //{
  //  ROS_INFO("Action server reported successful execution");
    //return true;
  //} else {
    //ROS_WARN("Action server could not execute trajectory");
    //return false;
  //}
}

i can't figure out what's the problem of my code,.when i catkin_make the code, the output of the terminal is:

/home/lkj/catkin_ws/src/move_group_test/src/cartesian.cpp: In function ‘bool executeTrajectory(const JointTrajectory&)’:

    /home/lkj/catkin_ws/src/move_group_test/src/cartesian.cpp:199:19: error: no matching function for call to ‘actionlib::SimpleActionClient<moveit_msgs::ExecuteTrajectoryAction_<std::allocator<void> > >::sendGoal(moveit_msgs::ExecuteTrajectoryAction&)’
   ac.sendGoal(goal);
                   ^
In file included from /home/lkj/catkin_ws/src/move_group_test/src/cartesian.cpp:9:0:
/opt/ros/kinetic/include/actionlib/client/simple_action_client.h:316:6: note: candidate: void actionlib::SimpleActionClient<ActionSpec>::sendGoal(const Goal&, actionlib::SimpleActionClient<ActionSpec>::SimpleDoneCallback, actionlib::SimpleActionClient<ActionSpec>::SimpleActiveCallback, 

actionlib::SimpleActionClient<ActionSpec>::SimpleFeedbackCallback) [with ActionSpec = moveit_msgs::ExecuteTrajectoryAction_<std::allocator<void> >; actionlib::SimpleActionClient<ActionSpec>::Goal = moveit_msgs::ExecuteTrajectoryGoal_<std::allocator<void> >; actionlib::SimpleActionClient<ActionSpec>::SimpleDoneCallback = boost::function<void(const actionlib::SimpleClientGoalState&, const boost::shared_ptr<const moveit_msgs::ExecuteTrajectoryResult_<std::allocator<void> > >&)>; typename ActionSpec::_action_result_type::_result_type = moveit_msgs::ExecuteTrajectoryResult_<std::allocator<void> >; actionlib::SimpleActionClient<ActionSpec>::SimpleActiveCallback = boost::function<void()>; actionlib::SimpleActionClient<ActionSpec>::SimpleFeedbackCallback = boost::function<void(const boost::shared_ptr<const moveit_msgs::ExecuteTrajectoryFeedback_<std::allocator<void> > >&)>; typename ActionSpec::_action_feedback_type::_feedback_type = moveit_msgs::ExecuteTrajectoryFeedback_<std::allocator<void> >]
 void SimpleActionClient<ActionSpec>::sendGoal(const Goal& goal,

      ^
/opt/ros/kinetic/include/actionlib/client/simple_action_client.h:316:6: note:   no known conversion for argument 1 from ‘moveit_msgs::ExecuteTrajectoryAction {aka moveit_msgs::ExecuteTrajectoryAction_<std::allocator<void> >}’ to ‘const Goal& {aka const moveit_msgs::ExecuteTrajectoryGoal_<std::allocator<void> >&}’
move_group_test/CMakeFiles/cartesian.dir/build.make:62: recipe for target 'move_group_test/CMakeFiles/cartesian.dir/src/cartesian.cpp.o' failed
make[2]: *** [move_group_test/CMakeFiles/cartesian.dir/src/cartesian.cpp.o] Error 1
CMakeFiles/Makefile2:5647: recipe for target 'move_group_test/CMakeFiles/cartesian.dir/all' failed
make[1]: *** [move_group_test/CMakeFiles/cartesian.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

so why there is no matching function of sendGoal()??

Thanks!

edit retag flag offensive close merge delete

Comments

Not sure if you ever figured this out, but I have the exact same issue.

jbeck28 gravatar image jbeck28  ( 2018-05-17 08:08:18 -0500 )edit

Have you found the reason or any solution? Would be appreciate to get your response on this issue. Thanks in advance.

songshan gravatar image songshan  ( 2019-02-20 01:43:10 -0500 )edit

1 Answer

Sort by » oldest newest most voted
4

answered 2018-07-26 12:12:02 -0500

troniak gravatar image

This is a tricky one. Remove the word 'Action' from moveit_msgs::ExecuteTrajectoryActionGoal.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-05-01 06:59:32 -0500

Seen: 1,208 times

Last updated: Jul 26 '18