コード例 #1
0
  //Close the gripper
  void close(){
    pr2_controllers_msgs::Pr2GripperCommandGoal squeeze;
    squeeze.command.position = 0.0;
    squeeze.command.max_effort = -1.0;

    ROS_INFO("Sending squeeze goal");
    gripper_client_->sendGoal(squeeze);
    gripper_client_->waitForResult();
    if(gripper_client_->getState() == actionlib::SimpleClientGoalState::SUCCEEDED)
      ROS_INFO("The gripper closed!");
    else
      ROS_INFO("The gripper failed to close.");
  }
コード例 #2
0
  //Open the gripper
  void open(){
    pr2_controllers_msgs::Pr2GripperCommandGoal open;
    open.command.position = 0.08;
    open.command.max_effort = -1.0;

    ROS_INFO("Sending open goal");
    gripper_client_->sendGoal(open);
    gripper_client_->waitForResult();
    if(gripper_client_->getState() == actionlib::SimpleClientGoalState::SUCCEEDED)
      ROS_INFO("The gripper opened!");
    else
      ROS_INFO("The gripper failed to open.");
  }
コード例 #3
0
		//Open the gripper
		bool open(){
			pr2_controllers_msgs::Pr2GripperCommandGoal open;
			open.command.position = 0.08;
			open.command.max_effort = -1.0;  // Do not limit effort (negative)

			ROS_INFO("Sending open goal");
			gripper_client_->sendGoal(open);
			gripper_client_->waitForResult();
			if(gripper_client_->getState() == actionlib::SimpleClientGoalState::SUCCEEDED) {
				ROS_INFO("The gripper opened!");
				return true;
			}
			else {
				ROS_INFO("The gripper failed to open.");
				return false;
			}
		}