pen_gripper.cpp
Go to the documentation of this file.
00001 /*
00002  * pen_gripper.cpp
00003  *
00004  *  Created on: 15.12.2010
00005  *      Author: Richard Schneider
00006  */
00007 #include <pen_gripper/pen_gripper.h>
00008 #include <tf/transform_datatypes.h>
00009 #define PI 3.1415926536
00010 #include <string>
00011 using namespace std;
00012 
00013 bool point_sort_x(pcl::PointXYZ a, pcl::PointXYZ b) {
00014         return a.x > b.x;
00015 }
00016 bool point_sort_y(pcl::PointXYZ a, pcl::PointXYZ b) {
00017         return a.y > b.y;
00018 }
00019 bool point_sort_z(pcl::PointXYZ a, pcl::PointXYZ b) {
00020         return a.z > b.z;
00021 }
00022 
00023 PenGripper::~PenGripper() {
00024         delete head;
00025 
00026         delete arm_l;
00027         delete arm_r;
00028 
00029         delete GripperRight;
00030         delete GripperLeft;
00031 }
00032 
00033 PenGripper::PenGripper(ros::NodeHandle& nh) {
00034 
00035         n = &nh;
00036 
00037         // head
00038         head = new actionlib::SimpleActionClient<
00039                         pr2_controllers_msgs::PointHeadAction>(
00040                         "/head_traj_controller/point_head_action", true);
00041 
00042         // arms
00043         arm_r = new EECartImpedArm("r_arm_cart_imped_controller");
00044         arm_l = new EECartImpedArm("l_arm_cart_imped_controller");
00045 
00046         // right gripper start position
00047         r_start_pos.x = 0.0;
00048         r_start_pos.y = -0.5;
00049         r_start_pos.z = 0.3;
00050 
00051         // left gripper start position
00052         l_start_pos.x = 0.0;
00053         l_start_pos.y = 0.5;
00054         l_start_pos.z = 0.3;
00055 
00056         // gripper action client
00057         GripperRight = new actionlib::SimpleActionClient<
00058                         pr2_controllers_msgs::Pr2GripperCommandAction>(
00059                         "r_gripper_controller/gripper_action", true);
00060         GripperLeft = new actionlib::SimpleActionClient<
00061                         pr2_controllers_msgs::Pr2GripperCommandAction>(
00062                         "l_gripper_controller/gripper_action", true);
00063 
00064         //wait for the gripper action server to come up
00065         while (!GripperRight->waitForServer(ros::Duration(5.0))) {
00066                 ROS_INFO("Waiting for the right gripper action server to come up");
00067         }
00068 
00069         //wait for the gripper action server to come up
00070         while (!GripperRight->waitForServer(ros::Duration(5.0))) {
00071                 ROS_INFO("Waiting for the left gripper action server to come up");
00072         }
00073 
00074         // status client publishing at /alubsc/status_msg
00075         status_clt = n->serviceClient < portrait_robot_msgs::alubsc_status_msg
00076                         > ("/alubsc/status_msg");
00077         // narrow stereo textured point cloud
00078         pcl_sub = n->subscribe("/narrow_stereo_textured/points2", 1,
00079                         &PenGripper::narrow_stereo_cb, this);
00080         // filtered cloud
00081         pcl_pub = n->advertise < sensor_msgs::PointCloud2
00082                         > ("/filtered_pointcloud", 1);
00083 
00084         // pcl marker publisher
00085         marker_middle_pub = n->advertise < visualization_msgs::Marker
00086                         > ("visualization_middle", 1);
00087 
00088         // 1 for pen gripper
00089         status.request.ID = 1;
00090 
00091         // pen status
00092         red_pen.isReady = false;
00093 
00094         // success of execution
00095         success = false;
00096         // client request
00097         abort = true;
00098 }
00099 
00100 void PenGripper::open_gripper(const string gripper) {
00101 
00102         if (gripper == "right") {
00103                 ROS_INFO("open the right gripper");
00104                 status.request.message = "open the right gripper";
00105                 status_clt.call(status);
00106 
00107                 pr2_controllers_msgs::Pr2GripperCommandGoal open;
00108                 open.command.position = 0.08;
00109                 open.command.max_effort = -1.0; // Do not limit effort (negative)
00110 
00111                 // open the gripper and wait for the result
00112                 GripperRight->sendGoal(open);
00113                 GripperRight->waitForResult();
00114 
00115                 if (GripperRight->getState()
00116                                 == actionlib::SimpleClientGoalState::SUCCEEDED) {
00117                         ROS_INFO("The right gripper is open");
00118                         status.request.message = "The right gripper is open.";
00119                         status_clt.call(status);
00120                 } else {
00121                         ROS_INFO("The right gripper failed to open.");
00122                         status.request.message = "The right gripper failed to open.";
00123                         status_clt.call(status);
00124                 }
00125         }
00126 
00127         if (gripper == "left") {
00128                 ROS_INFO("open the left gripper");
00129                 status.request.message = "open the left gripper";
00130                 status_clt.call(status);
00131 
00132                 pr2_controllers_msgs::Pr2GripperCommandGoal open;
00133                 open.command.position = 0.08;
00134                 open.command.max_effort = -1.0; // Do not limit effort (negative)
00135 
00136                 // open the gripper and wait for the result
00137                 GripperLeft->sendGoal(open);
00138                 GripperLeft->waitForResult();
00139 
00140                 if (GripperLeft->getState()
00141                                 == actionlib::SimpleClientGoalState::SUCCEEDED) {
00142                         ROS_INFO("The left gripper open");
00143                         status.request.message = "The left gripper is open.";
00144                         status_clt.call(status);
00145                 } else {
00146                         ROS_INFO("The left gripper failed to open.");
00147                         status.request.message = "The left gripper failed to open.";
00148                         status_clt.call(status);
00149                 }
00150         }
00151 
00152 }
00153 
00154 void PenGripper::close_gripper(const string gripper) {
00155 
00156         if (gripper == "right") {
00157 
00158                 ROS_INFO("close the right gripper");
00159 
00160                 status.request.message = "close the right gripper";
00161                 status_clt.call(status);
00162 
00163                 pr2_controllers_msgs::Pr2GripperCommandGoal squeeze;
00164                 squeeze.command.position = 0.0;
00165                 squeeze.command.max_effort = 50.0; // Close gently
00166 
00167                 // close the gripper and wait for the result
00168                 GripperRight->sendGoal(squeeze);
00169                 GripperRight->waitForResult();
00170                 if (GripperRight->getState()
00171                                 == actionlib::SimpleClientGoalState::SUCCEEDED) {
00172                         ROS_INFO("The right gripper is closed");
00173                         status.request.message = "The right gripper is closed";
00174                         status_clt.call(status);
00175                 } else {
00176                         ROS_INFO("The right gripper failed to close.");
00177                         status.request.message = "The right gripper failed to close";
00178                         status_clt.call(status);
00179                 }
00180         }
00181 
00182         if (gripper == "left") {
00183 
00184                 ROS_INFO("close the left gripper");
00185 
00186                 status.request.message = "close the left gripper";
00187                 status_clt.call(status);
00188 
00189                 pr2_controllers_msgs::Pr2GripperCommandGoal squeeze;
00190                 squeeze.command.position = 0.0;
00191                 squeeze.command.max_effort = 50.0; // Close gently
00192 
00193                 // close the gripper and wait for the result
00194                 GripperLeft->sendGoal(squeeze);
00195                 GripperLeft->waitForResult();
00196                 if (GripperLeft->getState()
00197                                 == actionlib::SimpleClientGoalState::SUCCEEDED) {
00198                         ROS_INFO("The left gripper is closed");
00199                         status.request.message = "The left gripper is closed";
00200                         status_clt.call(status);
00201                 } else {
00202                         ROS_INFO("The left gripper failed to close.");
00203                         status.request.message = "The left gripper failed to close";
00204                         status_clt.call(status);
00205                 }
00206         }
00207 
00208 }
00209 
00210 void PenGripper::take_start_position() {
00211 
00212         ROS_INFO("take start position");
00213         status.request.message = "take start position";
00214         status_clt.call(status);
00215 
00216         // move the head
00217         ROS_INFO("set the head posture");
00218         status.request.message = "set the head posture";
00219         status_clt.call(status);
00220 
00221         //wait for head controller action server to come up
00222         while (!head->waitForServer(ros::Duration(5.0))) {
00223                 ROS_INFO("Waiting for the point_head_action server to come up");
00224         }
00225 
00226         //the goal message with a "looking at" goal
00227         pr2_controllers_msgs::PointHeadGoal goal;
00228 
00229         //the target point, expressed in the requested frame
00230         geometry_msgs::PointStamped point;
00231         // point is in /torso_lift_link frame
00232         point.header.frame_id = "/torso_lift_link";
00233         // actual point values
00234         point.point.x = 0.6;
00235         point.point.y = 0.0;
00236         point.point.z = -0.4;
00237         goal.target = point;
00238 
00239         //we are pointing the high-def camera frame
00240         //(pointing_axis defaults to X-axis)
00241         goal.pointing_frame = "high_def_frame";
00242 
00243         //take at least 0.5 seconds to get there
00244         goal.min_duration = ros::Duration(5.0);
00245 
00246         //and go no faster than 1 rad/s
00247         goal.max_velocity = 1.0;
00248 
00249         //send the goal
00250         head->sendGoal(goal);
00251 
00252         //wait for it to get there (abort after 2 secs to prevent getting stuck)
00253         head->waitForResult(ros::Duration(2));
00254 
00255 //      ROS_INFO("start the projector");
00256 //      status.request.message = "start the projector";
00257 //      status_clt.call(status);
00258 //
00259 //      // start the projector
00260 //      system(
00261 //                      "rosrun dynamic_reconfigure dynparam set /camera_synchronizer_node narrow_stereo_trig_mode 3");
00262 
00263         // horizontal orientation for the gripper
00264         tf::Quaternion up = tf::createQuaternionFromRPY(0.0, -0.5 * PI, PI);
00265 
00266         // hanging orientation for the gripper
00267         btQuaternion down = tf::createQuaternionFromRPY(0.0, 0.5 * PI, PI);
00268 
00269         // trajectory goals for the gripper movement
00270         ee_cart_imped_msgs::EECartImpedGoal traj_r, traj_l;
00271 
00272         // add start position point of the left gripper
00273         EECartImpedArm::addTrajectoryPoint(traj_l, l_start_pos.x, l_start_pos.y,
00274                         l_start_pos.z, up.x(), up.y(), up.z(), up.w(), 1000, 1000, 1000, 30,
00275                         30, 30, false, false, false, false, false, false, 6,
00276                         "/torso_lift_link");
00277 
00278         // add start position point of the right gripper
00279         EECartImpedArm::addTrajectoryPoint(traj_r, r_start_pos.x, r_start_pos.y,
00280                         r_start_pos.z, up.x(), up.y(), up.z(), up.w(), 1000, 1000, 1000, 30,
00281                         30, 30, false, false, false, false, false, false, 6,
00282                         "/torso_lift_link");
00283 
00284         ROS_INFO("set the arm position");
00285         status.request.message = "set the arm position";
00286         status_clt.call(status);
00287 
00288         // starts the arm movement
00289         arm_l->startTrajectory(traj_l);
00290         arm_r->startTrajectory(traj_r);
00291         // remove all points from the goal
00292         arm_l->stopTrajectory();
00293         arm_r->stopTrajectory();
00294 
00295 }
00296 
00297 void PenGripper::narrow_stereo_cb(
00298                 const sensor_msgs::PointCloud2ConstPtr& cloud2_msg_ptr) {
00299 
00300 
00301         ROS_INFO("the pen is ready now");
00302         status.request.message = "the pen is ready now";
00303         status_clt.call(status);
00304 
00305         red_pen.isReady = true;
00307 //      if (!abort) {
00308 //              ROS_INFO("pen detection");
00309 //
00310 //              // input msg in poincloud1 format
00311 //              sensor_msgs::PointCloud cloud1_msg;
00312 //
00313 //              // transformed cloud msg
00314 //              sensor_msgs::PointCloud transformed_cloud1_msg;
00315 //              // transformed cloud2 msg
00316 //              sensor_msgs::PointCloud2 transformed_cloud2_msg;
00317 //
00318 //              // incoming pointcloud in /torso_lift_link frame
00319 //              pcl::PointCloud < pcl::PointXYZ > cloud;
00320 //
00321 //              //Passthrough Filter
00322 //              pcl::PassThrough < pcl::PointXYZ > pass;
00323 //
00324 //              // filtered pointcloud
00325 //              pcl::PointCloud < pcl::PointXYZ > cloud_filtered;
00326 //
00327 //              // tf transformation
00328 //              tf::StampedTransform transform;
00329 //              sensor_msgs::convertPointCloud2ToPointCloud(*cloud2_msg_ptr,
00330 //                              cloud1_msg);
00331 //
00332 //              ros::Time now = ros::Time::now();
00333 //              tflistener.waitForTransform("/torso_lift_link",
00334 //                              "/narrow_stereo_optical_frame", now, ros::Duration(5.0 / 30.0));
00335 //
00336 //              tflistener.lookupTransform("/torso_lift_link",
00337 //                              "/narrow_stereo_optical_frame", now, transform);
00338 //
00339 //              tflistener.transformPointCloud("/torso_lift_link", cloud1_msg,
00340 //                              transformed_cloud1_msg);
00341 //              sensor_msgs::convertPointCloudToPointCloud2(transformed_cloud1_msg,
00342 //                              transformed_cloud2_msg);
00343 //
00344 //              // pointcloud 2 message to Pointcloud
00345 //              pcl::fromROSMsg(transformed_cloud2_msg, cloud);
00346 //
00347 //              ROS_INFO("PointCloud before filtering has: %zu data points.",
00348 //                              cloud.points.size());
00349 //
00350 //              // build the passthrough filter, substract all points with x < 0.3 or x > 0.8
00351 //              pass.setInputCloud(cloud.makeShared());
00352 //              pass.setFilterFieldName("x");
00353 //              pass.setFilterLimits(0.3, 0.8);
00354 //              pass.filter(cloud_filtered);
00355 //
00356 //              ROS_INFO("PointCloud after filtering has: %zu data points.",
00357 //                              cloud_filtered.points.size());
00358 //
00359 //              // all objects needed
00360 //              pcl::NormalEstimation < pcl::PointXYZ, pcl::Normal > ne;
00361 //
00362 //              pcl::PointCloud < pcl::Normal > cloud_normals;
00363 //              pcl::KdTreeFLANN<pcl::PointXYZ>::Ptr tree = boost::make_shared<
00364 //                              pcl::KdTreeFLANN<pcl::PointXYZ> >();
00365 //
00366 //              // Estimate point normals
00367 //              ne.setSearchMethod(tree);
00368 //              ne.setInputCloud(cloud_filtered.makeShared());
00369 //              ne.setKSearch(50);
00370 //              ne.compute(cloud_normals);
00371 //
00372 //              // Create the segmentation object for the planar model and set all the parameters
00373 //              pcl::SACSegmentationFromNormals < pcl::PointXYZ, pcl::Normal > seg;
00374 //              pcl::PointIndices::Ptr inliers_plane(new pcl::PointIndices()),
00375 //                              inliers_cylinder(new pcl::PointIndices());
00376 //              pcl::ModelCoefficients::Ptr coefficients_plane(
00377 //                              new pcl::ModelCoefficients()), coefficients_cylinder(
00378 //                              new pcl::ModelCoefficients());
00379 //
00380 //              // plane segmentation
00381 //              seg.setOptimizeCoefficients(true);
00382 //              seg.setModelType(pcl::SACMODEL_NORMAL_PLANE);
00383 //              seg.setNormalDistanceWeight(0.1);
00384 //              seg.setMethodType(pcl::SAC_RANSAC);
00385 //              seg.setMaxIterations(100);
00386 //              seg.setDistanceThreshold(0.03);
00387 //              seg.setInputCloud(cloud_filtered.makeShared());
00388 //              seg.setInputNormals(cloud_normals.makeShared());
00389 //
00390 //              // Obtain the plane inliers and coefficients
00391 //              seg.segment(*inliers_plane, *coefficients_plane);
00392 //              //std::cerr << "Plane coefficients: " << *coefficients_plane << std::endl;
00393 //
00394 //              if (inliers_plane->indices.size() == 0) {
00395 //
00396 //                      ROS_INFO("could not estimate the table surface");
00397 //                      status.request.message = "could not estimate the table surface";
00398 //                      status_clt.call(status);
00399 //                      red_pen.isReady = false;
00400 //                      success = false;
00401 //                      return;
00402 //
00403 //              } else {
00404 //
00405 //                      // mean height
00406 //                      float z_mean;
00407 //                      z_mean = 0.0;
00408 //
00409 //                      // compute a mean height of all estimated table surface inliers
00410 //                      for (size_t i = 0; i < inliers_plane->indices.size(); i++) {
00411 //                              z_mean = z_mean
00412 //                                              + cloud_filtered.points[inliers_plane->indices[i]].z;
00413 //                      }
00414 //
00415 //                      z_mean = z_mean / inliers_plane->indices.size();
00416 //
00417 //                      if (z_mean < -0.40) {
00418 //                              ROS_INFO("the table surface is to low");
00419 //                              status.request.message = "the table surface is to low";
00420 //                              status_clt.call(status);
00421 //                              red_pen.isReady = false;
00422 //                              success = false;
00423 //                              return;
00424 //                      } else {
00425 //
00426 //                              ROS_INFO("found the table surface");
00427 //                              status.request.message = "found the table surface";
00428 //                              status_clt.call(status);
00429 //
00430 //                              ROS_INFO("table height %f", z_mean);
00431 //
00432 //                              // find the highest point in the cloud
00433 //                              std::sort(cloud_filtered.begin(), cloud_filtered.end(),
00434 //                                              point_sort_z);
00435 //
00436 //                              ROS_INFO("pen height: %f", cloud_filtered.points[0].z - z_mean);
00437 //
00438 //                              //check if the pen is at least 0.10 cm high
00439 //                              if (cloud_filtered.points[0].z - z_mean >= 0.10) {
00440 //
00441 //                                      red_pen.middle.x = cloud_filtered.points[0].x;
00442 //                                      red_pen.middle.y = cloud_filtered.points[0].y;
00443 //
00444 //                                      // pen middle is between highest point and table surface
00445 //                                      red_pen.middle.z = z_mean
00446 //                                                      + (cloud_filtered.points[0].z - z_mean) / 2;
00447 //
00448 //                                      // set the pen middle point
00449 //                                      red_pen.head.x = cloud_filtered.points[0].x;
00450 //                                      red_pen.head.y = cloud_filtered.points[0].y;
00451 //                                      red_pen.head.z = cloud_filtered.points[0].z;
00452 //
00453 //                                      // output
00454 //                                      sensor_msgs::PointCloud2 filtered_pointcloud_msg;
00455 //                                      pcl::toROSMsg(cloud_filtered, filtered_pointcloud_msg);
00456 //                                      pcl_pub.publish(filtered_pointcloud_msg);
00457 //
00458 //                                      ROS_INFO("the pen is ready now");
00459 //                                      status.request.message = "the pen is ready now";
00460 //                                      status_clt.call(status);
00461 //
00462 //                                      red_pen.isReady = true;
00463 //
00464 //                              } else {
00465 //                                      ROS_INFO("the pen is not ready");
00466 //                                      status.request.message = "the pen is not ready";
00467 //                                      status_clt.call(status);
00468 //                                      red_pen.isReady = false;
00469 //                                      success = false;
00470 //                              }
00471 //
00472 //                              // ros marker
00473 //                              visualization_msgs::Marker marker_middle;
00474 //
00475 //                              // Set the frame ID and timestamp.  See the TF tutorials for information on these.
00476 //                              marker_middle.header.frame_id = "/torso_lift_link";
00477 //
00478 //                              marker_middle.header.stamp = ros::Time::now();
00479 //
00480 //                              // Set the namespace and id for this marker_head.  This serves to create a unique ID
00481 //                              // Any marker_head sent with the same namespace and id will overwrite the old one
00482 //                              marker_middle.ns = "pen_gripper";
00483 //                              marker_middle.id = 1;
00484 //                              marker_middle.type = visualization_msgs::Marker::SPHERE;
00485 //
00486 //                              // Set the marker_head action.  Options are ADD and DELETE
00487 //
00488 //                              marker_middle.action = visualization_msgs::Marker::ADD;
00489 //
00490 //                              // Set the pose of the marker_head.  This is a full 6DOF pose relative to the frame/time specified in the header
00491 //
00492 //                              marker_middle.pose.position.x = red_pen.head.x;
00493 //                              marker_middle.pose.position.y = red_pen.head.y;
00494 //                              marker_middle.pose.position.z = red_pen.head.z;
00495 //
00496 //                              // Set the scale of the marker_head -- 1x1x1 here means 1m on a side
00497 //
00498 //                              marker_middle.scale.x = 0.02;
00499 //                              marker_middle.scale.y = 0.02;
00500 //                              marker_middle.scale.z = 0.02;
00501 //
00502 //                              // Set the color -- be sure to set alpha to something non-zero!
00503 //
00504 //                              marker_middle.color.r = 1.0f;
00505 //                              marker_middle.color.g = 0.0f;
00506 //                              marker_middle.color.b = 0.0f;
00507 //                              marker_middle.color.a = 1.0;
00508 //
00509 //                              marker_middle.lifetime = ros::Duration();
00510 //
00511 //                              // Publish the marker_head
00512 //                              ROS_INFO("markers published");
00513 //                              marker_middle_pub.publish(marker_middle);
00514 //                      }
00515 //
00516 //              }
00517 //
00518 //              status.request.message = "stop the projector";
00519 //              status_clt.call(status);
00520 //              // stop the projector
00521 //              system(
00522 //                              "rosrun dynamic_reconfigure dynparam set /camera_synchronizer_node narrow_stereo_trig_mode 4");
00523 //
00524 //      }
00525 
00526 }
00527 
00528 void PenGripper::grip_pen()
00529 
00530 {
00531 
00532         success = true;
00533         //check if the pen is ready
00534         if (!red_pen.isReady) {
00535                 ROS_INFO("pen is not ready");
00536                 status.request.message = "pen is not ready";
00537                 status_clt.call(status);
00538 
00539         } else {
00540                 // open the right gripper
00541                 this->open_gripper("right");
00542 
00543                 ROS_INFO("grip the pen");
00544                 status.request.message = "grip the pen";
00545                 status_clt.call(status);
00546 
00547                 ee_cart_imped_msgs::EECartImpedGoal traj_r, end;
00548 
00549                 // gripper orientation in euler angles
00550                 tf::Quaternion grip_forward = tf::createQuaternionFromRPY(0.0, 0.0, PI);
00551                 tf::Quaternion grip_left = tf::createQuaternionFromRPY(0.5 * PI, 0.0, PI);
00552 
00553                 // point at 0.1 m of the right side of the pen
00554                 EECartImpedArm::addTrajectoryPoint(traj_r, double(red_pen.middle.x),
00555                                 double(red_pen.middle.y - 0.1), double(red_pen.middle.z),
00556                                 grip_left.x(), grip_left.y(), grip_left.z(), grip_left.w(),
00557                                 1000, 1000, 1000, 30, 30, 30, false, false, false, false, false,
00558                                 false, 8, "/torso_lift_link");
00559                 // pen position point
00560                 EECartImpedArm::addTrajectoryPoint(traj_r, double(red_pen.middle.x),
00561                                 double(red_pen.middle.y + 0.04),
00562                                 double(red_pen.middle.z - 0.01), grip_left.x(), grip_left.y(),
00563                                 grip_left.z(), grip_left.w(), 1000, 1000, 1000, 30, 30, 30,
00564                                 false, false, false, false, false, false, 12,
00565                                 "/torso_lift_link");
00566 
00567                 // start the gripper movement
00568                 arm_r->startTrajectory(traj_r);
00569 
00570                 // grip the pen
00571                 this->close_gripper("right");
00572 
00573                 // end position point
00574                 EECartImpedArm::addTrajectoryPoint(end, double(r_start_pos.x),
00575                                 double(r_start_pos.y), double(r_start_pos.z), grip_left.x(),
00576                                 grip_left.y(), grip_left.z(), grip_left.w(), 1000, 1000, 1000,
00577                                 30, 30, 30, false, false, false, false, false, false, 8,
00578                                 "/torso_lift_link");
00579                 // start to go to the end position
00580                 arm_r->startTrajectory(end);
00581 
00582                 // pen gripping was successfull
00583                 success = true;
00584 
00585         }
00586 
00587 }
00588 
00589 void PenGripper::reset() {
00590         // reset the pen_gripper object members
00591         red_pen.isReady = true;
00592         success = true;
00593         abort = true;
00594 
00595 //      red_pen.isReady = false;
00596 //      success = false;
00597 //      abort = true;
00598 }
00599 
00600 bool PenGripper::handle_req(
00601                 portrait_robot_msgs::alubsc_node_instr::Request &req,
00602                 portrait_robot_msgs::alubsc_node_instr::Response &res) {
00603 
00604         // handle the requests
00605         if (!req.abort) {
00606                 ROS_INFO("Incomming Request...");
00607                 status.request.message = "Incomming Request...";
00608                 status_clt.call(status);
00609 
00610                 // activate the pen_gripper
00611                 abort = false;
00612                 res.success = true;
00613                 return true;
00614         } else {
00615                 ROS_INFO("reset...");
00616                 status.request.message = "reset...";
00617                 status_clt.call(status);
00618 
00619                 // reset the object
00620                 this->reset();
00621                 res.success = true;
00622                 return true;
00623 
00624         }
00625 }
00626 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


pen_gripper
Author(s): Richard Schneider
autogenerated on Wed Dec 26 2012 16:16:39