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

kaijianliu's profile - activity

2022-12-30 17:12:47 -0500 received badge  Nice Question (source)
2020-05-21 01:36:05 -0500 received badge  Student (source)
2019-08-09 17:04:22 -0500 marked best answer [kinetic actionlib]no matching function for call ac.sendGoal(goal);

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!

2018-11-13 08:18:23 -0500 received badge  Taxonomist
2018-05-17 08:08:00 -0500 received badge  Famous Question (source)
2017-11-30 05:44:35 -0500 received badge  Notable Question (source)
2017-10-09 13:38:30 -0500 received badge  Famous Question (source)
2017-07-19 01:06:39 -0500 received badge  Popular Question (source)
2017-07-12 06:50:44 -0500 received badge  Notable Question (source)
2017-05-01 07:14:46 -0500 asked a question [kinetic actionlib]no matching function for call ac.sendGoal(goal)

[kinetic actionlib]no matching function for call ac.sendGoal(goal) I use actionlib to control ur3.I write the problem ac

2017-05-01 06:59:32 -0500 asked a question [kinetic actionlib]no matching function for call ac.sendGoal(goal);

[kinetic actionlib]no matching function for call ac.sendGoal(goal); I use actionlib to control ur3.I write the problem

2017-04-17 19:50:09 -0500 received badge  Popular Question (source)
2017-03-14 20:20:22 -0500 commented question [moveit] problem about Cartesian Paths of move_group_interface

I have worked out the problem. It was due to the reason that i should execute to the start point of the waypoints before i start compute cartesian. And also, I should set a longger time for compute cartesian path to ensure 100% acheved. Anyway, thanks.

2017-03-12 14:33:19 -0500 asked a question [moveit] problem about Cartesian Paths of move_group_interface

I follow tutorials in http://docs.ros.org/kinetic/api/movei...,and when i plan a Cartesian Paths for UR3, i write the following codes for UR3:

std::vector<geometry_msgs::Pose> waypoints;
  waypoints.push_back(target_pose1);

  geometry_msgs::Pose target_pose2 = target_pose1;

  target_pose2.position.z += 0.1;
  waypoints.push_back(target_pose2);  // up 
   target_pose2.position.y -= 0.1;
  waypoints.push_back(target_pose2);  // left
  target_pose2.position.z -= 0.1;
  target_pose2.position.y += 0.1;
  target_pose2.position.x -= 0.1;
  waypoints.push_back(target_pose2);  
  move_group.setMaxVelocityScalingFactor(0.1);
 moveit_msgs::RobotTrajectory trajectory;
  const double jump_threshold = 0.0;
  const double eef_step = 0.005;
  double fraction = move_group.computeCartesianPath(waypoints, eef_step, jump_threshold, trajectory);
  ROS_INFO_NAMED("tutorial", "Visualizing plan 4 (cartesian path) (%.2f%% acheived)", fraction * 100.0);
  sleep(15.0);

ROS_INFO_STREAM("cartesian path .....");
my_plan.trajectory_= trajectory;
move_group.execute(my_plan);

The problem is that the fuction double fraction = move_group.computeCartesianPath(waypoints, eef_step, jump_threshold, trajectory); seems work not well .In the terminal i got the following information:

 INFO] [1489330212.136327474]: Visualizing plan 4 (cartesian path) (0.00% acheived)
[ INFO] [1489330227.136626416]: cartesian path .....
[ WARN] [1489330227.461583608]: Skipping path because 1 points passed in.

Some problem occur when running the function for 0.00% has achieved as terminal implied. So it didn't plan out the cartesian path. soi can't see the path in rviz.