pr2_moveit_controller_manager.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2012, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 /* Author: Ioan Sucan, Sachin Chitta, E. Gil Jones */
36 
37 #include <ros/ros.h>
39 #include <control_msgs/FollowJointTrajectoryAction.h>
42 
43 #include <pr2_mechanism_msgs/ListControllers.h>
44 #include <pr2_mechanism_msgs/SwitchController.h>
45 #include <pr2_mechanism_msgs/LoadController.h>
46 #include <pr2_controllers_msgs/Pr2GripperCommandAction.h>
47 #include <algorithm>
48 #include <map>
49 
51 {
53 static const double DEFAULT_MAX_GRIPPER_EFFORT = 10000.0;
54 
56 static const double GRIPPER_OPEN = 0.086;
57 
59 static const double GRIPPER_CLOSED = 0.0;
60 
62 static const std::string R_GRIPPER_JOINT = "r_gripper_motor_screw_joint";
63 
65 static const std::string L_GRIPPER_JOINT = "l_gripper_motor_screw_joint";
66 
69 static const double GAP_CONVERSION_RATIO = 0.1714;
70 
71 template <typename T>
73 {
74 public:
75  ActionBasedControllerHandle(const std::string& name, const std::string& ns)
77  {
79  unsigned int attempts = 0;
80  while (ros::ok() && !controller_action_client_->waitForServer(ros::Duration(5.0)) && ++attempts < 3)
81  ROS_INFO_STREAM("Waiting for " << name_ + "/" + namespace_ << " to come up");
82 
83  if (!controller_action_client_->isServerConnected())
84  {
85  ROS_ERROR_STREAM("Action client not connected: " << name_ + "/" + namespace_);
87  }
88 
90  }
91 
92  bool isConnected() const
93  {
94  return static_cast<bool>(controller_action_client_);
95  }
96 
97  virtual bool cancelExecution()
98  {
100  return false;
101  if (!done_)
102  {
103  ROS_INFO_STREAM("Cancelling execution for " << name_);
104  controller_action_client_->cancelGoal();
106  done_ = true;
107  }
108  return true;
109  }
110 
111  virtual bool waitForExecution(const ros::Duration& timeout = ros::Duration(0))
112  {
114  return controller_action_client_->waitForResult(timeout);
115  return true;
116  }
117 
119  {
120  return last_exec_;
121  }
122 
123 protected:
125  {
126  ROS_DEBUG_STREAM("Controller " << name_ << " is done with state " << state.toString() << ": " << state.getText());
133  else
135  done_ = true;
136  }
137 
139  std::string namespace_;
140  bool done_;
142 };
143 
144 class Pr2GripperControllerHandle : public ActionBasedControllerHandle<pr2_controllers_msgs::Pr2GripperCommandAction>
145 {
146 public:
147  Pr2GripperControllerHandle(const std::string& name, const std::string& ns = "gripper_action")
148  : ActionBasedControllerHandle<pr2_controllers_msgs::Pr2GripperCommandAction>(name, ns), closing_(false)
149  {
150  }
151 
152  virtual bool sendTrajectory(const moveit_msgs::RobotTrajectory& trajectory)
153  {
155  return false;
156  if (!trajectory.multi_dof_joint_trajectory.points.empty())
157  {
158  ROS_ERROR("The PR2 gripper controller cannot execute multi-dof trajectories.");
159  return false;
160  }
161 
162  if (trajectory.joint_trajectory.points.back().positions.empty())
163  {
164  ROS_ERROR("The PR2 gripper controller expects a joint trajectory with one point that specifies at least one "
165  "position, but 0 positions provided)");
166  return false;
167  }
168 
169  if (trajectory.joint_trajectory.points.size() > 1)
170  ROS_DEBUG("The PR2 gripper controller expects a joint trajectory with one point only, but %u provided. Using "
171  "last point only.",
172  (unsigned int)trajectory.joint_trajectory.points.size());
173 
174  int gripper_joint_index = -1;
175  for (std::size_t i = 0; i < trajectory.joint_trajectory.joint_names.size(); ++i)
176  if (trajectory.joint_trajectory.joint_names[i] == R_GRIPPER_JOINT ||
177  trajectory.joint_trajectory.joint_names[i] == L_GRIPPER_JOINT)
178  {
179  gripper_joint_index = i;
180  break;
181  }
182 
183  if (!trajectory.joint_trajectory.joint_names.empty())
184  {
185  std::stringstream ss;
186  ss << std::endl;
187  for (std::size_t i = 0; i < trajectory.joint_trajectory.joint_names.size(); ++i)
188  ss << "PR2 gripper trajectory (" << i << "): " << trajectory.joint_trajectory.joint_names[i] << " "
189  << trajectory.joint_trajectory.points[0].positions[i] << std::endl;
190  ss << std::endl;
191  ROS_DEBUG("%s", ss.str().c_str());
192  }
193 
194  if (gripper_joint_index == -1)
195  {
196  ROS_ERROR("Could not find value for gripper virtual joint. Expected joint value for '%s' or '%s'.",
197  L_GRIPPER_JOINT.c_str(), R_GRIPPER_JOINT.c_str());
198  return false;
199  }
200 
201  double gap_opening =
202  trajectory.joint_trajectory.points.back().positions[gripper_joint_index] * GAP_CONVERSION_RATIO;
203  ROS_DEBUG("PR2 gripper gap opening: %f", gap_opening);
204  closing_ = false;
205 
206  if (gap_opening > GRIPPER_OPEN)
207  {
208  gap_opening = GRIPPER_OPEN;
209  closing_ = false;
210  }
211  else if (gap_opening <= 0.0)
212  {
213  gap_opening = 0.0;
214  closing_ = true;
215  }
216 
217  pr2_controllers_msgs::Pr2GripperCommandGoal goal;
218  goal.command.max_effort = DEFAULT_MAX_GRIPPER_EFFORT;
219 
220  goal.command.position = gap_opening;
221  controller_action_client_->sendGoal(goal,
222  boost::bind(&Pr2GripperControllerHandle::controllerDoneCallback, this, _1, _2),
225  done_ = false;
227  return true;
228  }
229 
230 private:
232  const pr2_controllers_msgs::Pr2GripperCommandResultConstPtr& result)
233  {
234  // the gripper action reports failure when closing the gripper and an object is inside
235  if (state == actionlib::SimpleClientGoalState::ABORTED && closing_)
237  else
239  }
240 
242  {
243  ROS_DEBUG_STREAM("Controller " << name_ << " started execution");
244  }
245 
246  void controllerFeedbackCallback(const pr2_controllers_msgs::Pr2GripperCommandFeedbackConstPtr& feedback)
247  {
248  }
249 
250  bool closing_;
251 };
252 
254  : public ActionBasedControllerHandle<control_msgs::FollowJointTrajectoryAction>
255 {
256 public:
257  Pr2FollowJointTrajectoryControllerHandle(const std::string& name, const std::string& ns = "follow_joint_trajectory")
258  : ActionBasedControllerHandle<control_msgs::FollowJointTrajectoryAction>(name, ns)
259  {
260  }
261 
262  virtual bool sendTrajectory(const moveit_msgs::RobotTrajectory& trajectory)
263  {
265  return false;
266  if (!trajectory.multi_dof_joint_trajectory.points.empty())
267  {
268  ROS_ERROR("The PR2 FollowJointTrajectory controller cannot execute multi-dof trajectories.");
269  return false;
270  }
271  if (done_)
272  ROS_DEBUG_STREAM("Sending trajectory to FollowJointTrajectory action for controller " << name_);
273  else
275  "Sending continuation for the currently executed trajectory to FollowJointTrajectory action for controller "
276  << name_);
277  control_msgs::FollowJointTrajectoryGoal goal;
278  goal.trajectory = trajectory.joint_trajectory;
279  controller_action_client_->sendGoal(
283  done_ = false;
285  return true;
286  }
287 
288 protected:
290  const control_msgs::FollowJointTrajectoryResultConstPtr& result)
291  {
293  }
294 
296  {
297  ROS_DEBUG_STREAM("Controller " << name_ << " started execution");
298  }
299 
300  void controllerFeedbackCallback(const control_msgs::FollowJointTrajectoryFeedbackConstPtr& feedback)
301  {
302  }
303 };
304 
306 {
307 public:
308  Pr2MoveItControllerManager() : node_handle_("~")
309  {
310  if (node_handle_.hasParam("controller_manager_name"))
311  node_handle_.getParam("controller_manager_name", controller_manager_name_);
312  if (controller_manager_name_.empty())
313  node_handle_.param("pr2_controller_manager_name", controller_manager_name_,
314  std::string("pr2_controller_manager"));
315  if (node_handle_.hasParam("use_controller_manager")) // 'use_controller_manager' is the old name
316  node_handle_.param("use_controller_manager", use_controller_manager_, true);
317  else
318  node_handle_.param("use_pr2_controller_manager", use_controller_manager_, true);
319 
320  XmlRpc::XmlRpcValue controller_list;
321  if (node_handle_.hasParam("controller_list"))
322  {
323  node_handle_.getParam("controller_list", controller_list);
324  if (controller_list.getType() != XmlRpc::XmlRpcValue::TypeArray)
325  ROS_WARN("Controller list should be specified as an array");
326  else
327  for (int i = 0; i < controller_list.size(); ++i)
328  if (!controller_list[i].hasMember("name") || !controller_list[i].hasMember("joints"))
329  ROS_WARN("Name and joints must be specifed for each controller");
330  else
331  {
332  try
333  {
335  std::string name = std::string(controller_list[i]["name"]);
336  if (controller_list[i].hasMember("default"))
337  {
338  try
339  {
340  if (controller_list[i]["default"].getType() == XmlRpc::XmlRpcValue::TypeBoolean)
341  {
342  ci.default_ = controller_list[i]["default"];
343  }
344  else
345  {
346  std::string def = std::string(controller_list[i]["default"]);
347  std::transform(def.begin(), def.end(), def.begin(), ::tolower);
348  if (def == "true" || def == "yes")
349  ci.default_ = true;
350  }
351  }
352  catch (...)
353  {
354  }
355  }
356  // 'ns' is the old name; use action_ns instead
357  if (controller_list[i].hasMember("ns"))
358  {
359  ci.ns_ = std::string(controller_list[i]["ns"]);
360  ROS_WARN("'ns' argument specified. Please use 'action_ns' instead.");
361  }
362  if (controller_list[i].hasMember("action_ns"))
363  ci.ns_ = std::string(controller_list[i]["action_ns"]);
364  if (controller_list[i]["joints"].getType() == XmlRpc::XmlRpcValue::TypeArray)
365  {
366  int nj = controller_list[i]["joints"].size();
367  for (int j = 0; j < nj; ++j)
368  ci.joints_.push_back(std::string(controller_list[i]["joints"][j]));
369  }
370  else
371  ROS_WARN_STREAM("The list of joints for controller " << name << " is not specified as an array");
372  if (!ci.joints_.empty())
373  possibly_unloaded_controllers_[name] = ci;
374  }
375  catch (...)
376  {
377  ROS_ERROR("Unable to parse controller information");
378  }
379  }
380  }
381  else
382  {
383  if (use_controller_manager_)
384  ROS_DEBUG_STREAM("No controller list specified. Using list obtained from the " << controller_manager_name_);
385  else
387  "Not using a controller manager and no controllers specified. There are no known controllers.");
388  }
389 
390  if (use_controller_manager_)
391  {
392  static const unsigned int max_attempts = 5;
393  unsigned int attempts = 0;
394  while (ros::ok() &&
395  !ros::service::waitForService(controller_manager_name_ + "/list_controllers", ros::Duration(5.0)) &&
396  ++attempts < max_attempts)
397  ROS_INFO_STREAM("Waiting for service " << controller_manager_name_ + "/list_controllers"
398  << " to come up");
399 
400  if (attempts < max_attempts)
401  while (ros::ok() &&
402  !ros::service::waitForService(controller_manager_name_ + "/switch_controller", ros::Duration(5.0)) &&
403  ++attempts < max_attempts)
404  ROS_INFO_STREAM("Waiting for service " << controller_manager_name_ + "/switch_controller"
405  << " to come up");
406 
407  if (attempts < max_attempts)
408  while (ros::ok() &&
409  !ros::service::waitForService(controller_manager_name_ + "/load_controller", ros::Duration(5.0)) &&
410  ++attempts < max_attempts)
411  ROS_INFO_STREAM("Waiting for service " << controller_manager_name_ + "/load_controller"
412  << " to come up");
413 
414  if (attempts < max_attempts)
415  {
416  lister_service_ = root_node_handle_.serviceClient<pr2_mechanism_msgs::ListControllers>(
417  controller_manager_name_ + "/list_controllers", true);
418  switcher_service_ = root_node_handle_.serviceClient<pr2_mechanism_msgs::SwitchController>(
419  controller_manager_name_ + "/switch_controller", true);
420  loader_service_ = root_node_handle_.serviceClient<pr2_mechanism_msgs::LoadController>(
421  controller_manager_name_ + "/load_controller", true);
422  }
423  else
424  ROS_ERROR("Not using the PR2 controller manager");
425  }
426  }
427 
429  {
430  }
431 
432  virtual moveit_controller_manager::MoveItControllerHandlePtr getControllerHandle(const std::string& name)
433  {
434  std::map<std::string, moveit_controller_manager::MoveItControllerHandlePtr>::const_iterator it =
435  handle_cache_.find(name);
436  if (it != handle_cache_.end())
437  return it->second;
438 
439  moveit_controller_manager::MoveItControllerHandlePtr new_handle;
440  if (possibly_unloaded_controllers_.find(name) != possibly_unloaded_controllers_.end())
441  {
442  const std::string& ns = possibly_unloaded_controllers_.at(name).ns_;
443  new_handle = getControllerHandleHelper(name, ns);
444  }
445  else
446  new_handle = getControllerHandleHelper(name, "");
447 
448  if (new_handle)
449  handle_cache_[name] = new_handle;
450  return new_handle;
451  }
452 
453  virtual void getControllersList(std::vector<std::string>& names)
454  {
455  const pr2_mechanism_msgs::ListControllers::Response& res = getListControllerServiceResponse();
456  std::set<std::string> names_set;
457  names_set.insert(res.controllers.begin(), res.controllers.end());
458 
459  for (std::map<std::string, ControllerInformation>::const_iterator it = possibly_unloaded_controllers_.begin();
460  it != possibly_unloaded_controllers_.end(); ++it)
461  names_set.insert(it->first);
462 
463  names.clear();
464  names.insert(names.end(), names_set.begin(), names_set.end());
465  }
466 
467  virtual void getActiveControllers(std::vector<std::string>& names)
468  {
469  names.clear();
470  if (use_controller_manager_)
471  {
472  const pr2_mechanism_msgs::ListControllers::Response& res = getListControllerServiceResponse();
473  for (std::size_t i = 0; i < res.controllers.size(); ++i)
474  if (res.state[i] == "running")
475  names.push_back(res.controllers[i]);
476  }
477  else
478  // we assume best case scenario if we can't test whether the controller is active or not
479  for (std::map<std::string, ControllerInformation>::const_iterator it = possibly_unloaded_controllers_.begin();
480  it != possibly_unloaded_controllers_.end(); ++it)
481  names.push_back(it->first);
482  }
483 
484  virtual void getControllerJoints(const std::string& name, std::vector<std::string>& joints)
485  {
486  std::map<std::string, ControllerInformation>::const_iterator it = possibly_unloaded_controllers_.find(name);
487  if (it != possibly_unloaded_controllers_.end())
488  joints = it->second.joints_;
489  else
490  {
491  joints.clear();
492  std::string param_name;
493  if (node_handle_.searchParam(name + "/joints", param_name))
494  {
495  XmlRpc::XmlRpcValue joints_list;
496  node_handle_.getParam(param_name, joints_list);
497  if (joints_list.getType() == XmlRpc::XmlRpcValue::TypeArray)
498  for (int i = 0; i < joints_list.size(); ++i)
499  joints.push_back((std::string)joints_list[i]);
500  }
501  else if (node_handle_.searchParam(name + "/joint", param_name))
502  {
503  std::string joint_name;
504  if (node_handle_.getParam(param_name, joint_name))
505  joints.push_back(joint_name);
506  }
507  if (joints.empty())
508  ROS_INFO("The joints for controller '%s' are not known and were not found on the ROS param server under "
509  "'%s/joints'or '%s/joint'. "
510  "Perhaps the controller configuration is not loaded on the param server?",
511  name.c_str(), name.c_str(), name.c_str());
512  ControllerInformation& ci = possibly_unloaded_controllers_[name];
513  ci.joints_ = joints;
514  }
515  }
516 
518  getControllerState(const std::string& name)
519  {
521  if (use_controller_manager_)
522  {
523  const pr2_mechanism_msgs::ListControllers::Response& res = getListControllerServiceResponse();
524  for (std::size_t i = 0; i < res.controllers.size(); ++i)
525  {
526  if (res.controllers[i] == name)
527  {
528  if (res.state[i] == "running")
529  state.active_ = true;
530  break;
531  }
532  }
533  }
534  else
535  {
536  // if we cannot test, assume best case scenario.
537  state.active_ = true;
538  }
539 
540  std::map<std::string, ControllerInformation>::const_iterator it = possibly_unloaded_controllers_.find(name);
541  if (it != possibly_unloaded_controllers_.end())
542  if (it->second.default_)
543  state.default_ = true;
544  return state;
545  }
546 
547  virtual bool switchControllers(const std::vector<std::string>& activate, const std::vector<std::string>& deactivate)
548  {
549  if (!use_controller_manager_)
550  {
551  ROS_WARN_STREAM("Cannot switch controllers without using the controller manager");
552  return false;
553  }
554 
555  if (!activate.empty())
556  {
557  // load controllers to be activated, if needed
558  const std::vector<std::string>& loaded_c = getListControllerServiceResponse().controllers;
559  std::set<std::string> loaded_c_set(loaded_c.begin(), loaded_c.end());
560  for (std::size_t i = 0; i < activate.size(); ++i)
561  if (loaded_c_set.find(activate[i]) == loaded_c_set.end())
562  {
563  handle_cache_.erase(activate[i]);
564  pr2_mechanism_msgs::LoadController::Request req;
565  pr2_mechanism_msgs::LoadController::Response res;
566  req.name = activate[i];
567  if (!loader_service_.call(req, res))
568  {
569  ROS_WARN("Something went wrong with loader service while trying to load '%s'", req.name.c_str());
570  return false;
571  }
572  if (!res.ok)
573  {
574  ROS_WARN("Loading controller '%s' failed", req.name.c_str());
575  return false;
576  }
577  }
578  }
579 
580  last_lister_response_ = ros::Time();
581  pr2_mechanism_msgs::SwitchController::Request req;
582  pr2_mechanism_msgs::SwitchController::Response res;
583 
584  req.strictness = pr2_mechanism_msgs::SwitchController::Request::BEST_EFFORT;
585  req.start_controllers = activate;
586  req.stop_controllers = deactivate;
587  if (!switcher_service_.call(req, res))
588  {
589  ROS_WARN_STREAM("Something went wrong with switcher service");
590  return false;
591  }
592  if (!res.ok)
593  ROS_WARN_STREAM("Switcher service failed");
594  return res.ok;
595  }
596 
597 protected:
598  const pr2_mechanism_msgs::ListControllers::Response& getListControllerServiceResponse()
599  {
600  if (use_controller_manager_)
601  {
602  static const ros::Duration max_cache_age(1.0);
603  if ((ros::Time::now() - last_lister_response_) > max_cache_age)
604  {
605  pr2_mechanism_msgs::ListControllers::Request req;
606  if (!lister_service_.call(req, cached_lister_response_))
607  ROS_WARN_STREAM("Something went wrong with lister service");
608  last_lister_response_ = ros::Time::now();
609  }
610  }
611  return cached_lister_response_;
612  }
613 
614  moveit_controller_manager::MoveItControllerHandlePtr getControllerHandleHelper(const std::string& name,
615  const std::string& ns)
616  {
617  moveit_controller_manager::MoveItControllerHandlePtr new_handle;
618  if (name == "l_gripper_controller" || name == "r_gripper_controller")
619  {
620  new_handle.reset(ns.empty() ? new Pr2GripperControllerHandle(name) : new Pr2GripperControllerHandle(name, ns));
621  if (!static_cast<Pr2GripperControllerHandle*>(new_handle.get())->isConnected())
622  new_handle.reset();
623  }
624  else
625  {
626  new_handle.reset(ns.empty() ? new Pr2FollowJointTrajectoryControllerHandle(name) :
628  if (!static_cast<Pr2FollowJointTrajectoryControllerHandle*>(new_handle.get())->isConnected())
629  new_handle.reset();
630  }
631  return new_handle;
632  }
633 
636 
642 
644  pr2_mechanism_msgs::ListControllers::Response cached_lister_response_;
645 
646  std::map<std::string, moveit_controller_manager::MoveItControllerHandlePtr> handle_cache_;
647 
649  {
650  ControllerInformation() : default_(false)
651  {
652  }
653 
654  bool default_;
655  std::string ns_;
656  std::vector<std::string> joints_;
657  };
658  std::map<std::string, ControllerInformation> possibly_unloaded_controllers_;
659 };
660 }
661 
std::map< std::string, moveit_controller_manager::MoveItControllerHandlePtr > handle_cache_
virtual bool sendTrajectory(const moveit_msgs::RobotTrajectory &trajectory)
const pr2_mechanism_msgs::ListControllers::Response & getListControllerServiceResponse()
static const double DEFAULT_MAX_GRIPPER_EFFORT
Maximum effort the PR2 gripper is allowed to exert (read as &#39;very large value&#39;); this is PR2 specific...
static const double GRIPPER_CLOSED
The distance between the PR2 gripper fingers when fully closed (in m); this is PR2 specific...
std::string toString() const
pr2_mechanism_msgs::ListControllers::Response cached_lister_response_
#define ROS_ERROR(...)
virtual void getControllersList(std::vector< std::string > &names)
#define ROS_WARN(...)
Pr2FollowJointTrajectoryControllerHandle(const std::string &name, const std::string &ns="follow_joint_trajectory")
virtual moveit_controller_manager::MoveItControllerManager::ControllerState getControllerState(const std::string &name)
static const std::string R_GRIPPER_JOINT
The name of the joint we expect input for to decide how to actuate the right gripper; this is PR2 spe...
ActionBasedControllerHandle(const std::string &name, const std::string &ns)
static const std::string L_GRIPPER_JOINT
The name of the joint we expect input for to decide how to actuate the left gripper; this is PR2 spec...
Pr2GripperControllerHandle(const std::string &name, const std::string &ns="gripper_action")
void controllerFeedbackCallback(const control_msgs::FollowJointTrajectoryFeedbackConstPtr &feedback)
#define ROS_DEBUG(...)
boost::shared_ptr< actionlib::SimpleActionClient< T > > controller_action_client_
Type const & getType() const
#define ROS_INFO(...)
moveit_controller_manager::MoveItControllerHandlePtr getControllerHandleHelper(const std::string &name, const std::string &ns)
ROSCPP_DECL bool ok()
virtual void getControllerJoints(const std::string &name, std::vector< std::string > &joints)
void controllerDoneCallback(const actionlib::SimpleClientGoalState &state, const control_msgs::FollowJointTrajectoryResultConstPtr &result)
#define ROS_WARN_STREAM(args)
#define ROS_DEBUG_STREAM(args)
static const double GRIPPER_OPEN
The distance between the PR2 gripper fingers when fully open (in m); this is PR2 specific.
virtual moveit_controller_manager::ExecutionStatus getLastExecutionStatus()
PLUGINLIB_EXPORT_CLASS(pr2_moveit_controller_manager::Pr2MoveItControllerManager, moveit_controller_manager::MoveItControllerManager)
#define ROS_INFO_STREAM(args)
void controllerDoneCallback(const actionlib::SimpleClientGoalState &state, const pr2_controllers_msgs::Pr2GripperCommandResultConstPtr &result)
virtual bool switchControllers(const std::vector< std::string > &activate, const std::vector< std::string > &deactivate)
static Time now()
virtual moveit_controller_manager::MoveItControllerHandlePtr getControllerHandle(const std::string &name)
#define ROS_ERROR_STREAM(args)
virtual bool sendTrajectory(const moveit_msgs::RobotTrajectory &trajectory)
void controllerFeedbackCallback(const pr2_controllers_msgs::Pr2GripperCommandFeedbackConstPtr &feedback)
virtual bool waitForExecution(const ros::Duration &timeout=ros::Duration(0))
std::map< std::string, ControllerInformation > possibly_unloaded_controllers_
bool hasMember(const std::string &name) const
virtual void getActiveControllers(std::vector< std::string > &names)
void finishControllerExecution(const actionlib::SimpleClientGoalState &state)
ROSCPP_DECL bool waitForService(const std::string &service_name, int32_t timeout)


pr2_moveit_plugins
Author(s): Ioan Sucan , Sachin Chitta
autogenerated on Mon Feb 28 2022 22:51:25