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

nico_lauda's profile - activity

2017-04-17 14:19:01 -0500 received badge  Famous Question (source)
2017-04-17 14:19:01 -0500 received badge  Notable Question (source)
2016-11-02 06:51:39 -0500 received badge  Supporter (source)
2016-09-21 08:15:19 -0500 received badge  Enthusiast
2016-09-02 09:47:14 -0500 received badge  Popular Question (source)
2016-08-08 18:28:03 -0500 answered a question actionlib sendgoal arguments

I write this answer in order to help someone else in the future that will find similar difficulties.

I have found here the same code already solved. On line 38 just write grasp_action_client_ptr.sendGoal(grasp_goal); and It works.

2016-08-07 15:29:22 -0500 commented question actionlib sendgoal arguments

Thank you for your comment!. I changed the operator like you said, and now sendGoal is recognized, but I get "Invalid arguments" error. It seems that it doesn't recognize the callback functions. I don't care of the callback fcns, but if I don't put them in the sendGoal I get the error as well.

2016-08-07 12:43:37 -0500 received badge  Editor (source)
2016-08-07 04:41:58 -0500 asked a question actionlib sendgoal arguments

Hi everybody!

I'm following the ROS-I tutorial ( http://aeswiki.datasys.swri.edu/rosit... ), and I get stuck when I have to send a goal to the server using the sendGoal method. Reading the sendGoal reference ( http://docs.ros.org/hydro/api/actionl... ) I should provide the goal and three callback functions.

Do I have to manually define those callback functions?

However in line 32, I tried to insert those callback funcs as indicated in the reference but Eclipse says "Method 'sendGoal' could not be resolved". What should I do?

Thank you!

  #include <collision_avoidance_pick_and_place/pick_and_place.h>

/*    SET GRIPPER
  Goal:
      - Turn the vacuum gripper on or off.
  Hints:
      - Use the grasp action client to send an grasp request to the grasp server.
      - Confirm that the gripper was successfully opened or closed and exit on error
*/
void collision_avoidance_pick_and_place::PickAndPlace::set_gripper(bool do_grasp)
{
//  ROS_ERROR_STREAM("set_gripper is not implemented yet.  Aborting."); exit(1);

  // task variables
  object_manipulation_msgs::GraspHandPostureExecutionGoal grasp_goal;
  bool success;

  // set the corresponding gripper action in the "grasp_goal" object.
  if (do_grasp)
    grasp_goal.goal = object_manipulation_msgs::GraspHandPostureExecutionGoal::GRASP;
  else
    grasp_goal.goal = object_manipulation_msgs::GraspHandPostureExecutionGoal::RELEASE;

  /* Fill Code:
   * Goal:
   * - Send the grasp goal to the server.
   * Hints:
   * - Use the "sendGoal" method of the grasp client "grasp_action_client_ptr"
   * to make a call to the server.
   */
  /* ========  ENTER CODE HERE ======== */
  grasp_action_client_ptr.sendGoal(grasp_goal.goal, SimpleDoneCallback, SimpleActiveCallback, SimpleFeedbackCallback) ;


  /* Fill Code:
   * Goal:
   * - Confirm that client service call succeeded.
   * Hints:
   * - Use the "waitForResult" method of the client to wait for completion.
   * - Give "waitForResult" a timeout value of 4 seconds
   * - Timeouts in ros can be created using "ros::Duration(4.0f)".
   * - Save returned boolean from waitForResult() in the "success" variable.
   */
  /* ========  ENTER CODE HERE ======== */

  if(success)
  {
    if (do_grasp)
      ROS_INFO_STREAM("Gripper closed");
    else
      ROS_INFO_STREAM("Gripper opened");
  }
  else
  {
    ROS_ERROR_STREAM("Gripper failure");
    exit(1);
  }
}