controller_manager.h
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 */
36 
37 #ifndef MOVEIT_MOVEIT_CONTROLLER_MANAGER_
38 #define MOVEIT_MOVEIT_CONTROLLER_MANAGER_
39 
40 #include <vector>
41 #include <string>
42 #include <moveit_msgs/RobotTrajectory.h>
44 
47 {
50 {
51  enum Value
52  {
60  };
61 
63  {
64  }
65 
66  operator Value() const
67  {
68  return status_;
69  }
70 
71  explicit operator bool() const
72  {
73  return status_ == SUCCEEDED;
74  }
75 
77  std::string asString() const
78  {
79  switch (status_)
80  {
81  case RUNNING:
82  return "RUNNING";
83  case SUCCEEDED:
84  return "SUCCEEDED";
85  case PREEMPTED:
86  return "PREEMPTED";
87  case TIMED_OUT:
88  return "TIMED_OUT";
89  case ABORTED:
90  return "ABORTED";
91  case FAILED:
92  return "FAILED";
93  default:
94  return "UNKNOWN";
95  }
96  }
97 
98 private:
100 };
101 
103 
106 {
107 public:
109  MoveItControllerHandle(const std::string& name) : name_(name)
110  {
111  }
112 
114  {
115  }
116 
118  const std::string& getName() const
119  {
120  return name_;
121  }
122 
126  virtual bool sendTrajectory(const moveit_msgs::RobotTrajectory& trajectory) = 0;
127 
130  virtual bool cancelExecution() = 0;
131 
135  virtual bool waitForExecution(const ros::Duration& timeout = ros::Duration(0)) = 0;
136 
138  virtual ExecutionStatus getLastExecutionStatus() = 0;
139 
140 protected:
141  std::string name_;
142 };
143 
145 
154 {
155 public:
159  {
160  ControllerState() : active_(false), default_(false)
161  {
162  }
163 
166  bool active_;
167 
170  bool default_;
171  };
172 
175  {
176  }
177 
179  {
180  }
181 
184  virtual MoveItControllerHandlePtr getControllerHandle(const std::string& name) = 0;
185 
187  virtual void getControllersList(std::vector<std::string>& names) = 0;
188 
192  virtual void getActiveControllers(std::vector<std::string>& names) = 0;
193 
196  virtual void getControllerJoints(const std::string& name, std::vector<std::string>& joints) = 0;
197 
199  virtual ControllerState getControllerState(const std::string& name) = 0;
200 
202  virtual bool switchControllers(const std::vector<std::string>& activate,
203  const std::vector<std::string>& deactivate) = 0;
204 };
205 }
206 
207 #endif
MoveIt! sends commands to a controller via a handle that satisfies this interface.
bool default_
It is often the case that multiple controllers could be used to execute a motion. Marking a controlle...
const std::string & getName() const
Get the name of the controller this handle can send commands to.
MoveIt! does not enforce how controllers are implemented. To make your controllers usable by MoveIt...
robot_trajectory::RobotTrajectory trajectory(rmodel,"right_arm")
bool active_
A controller can be active or inactive. This means that MoveIt! could activate the controller when ne...
MoveItControllerManager()
Default constructor. This needs to have no arguments so that the plugin system can construct the obje...
Each controller known to MoveIt! has a state. This structure describes that controller&#39;s state...
MoveItControllerHandle(const std::string &name)
Each controller has a name. The handle is initialized with that name.
MOVEIT_CLASS_FORWARD(MoveItControllerHandle)
Namespace for the base class of a MoveIt! controller manager.
std::string asString() const
Convert the execution status to a string.


moveit_core
Author(s): Ioan Sucan , Sachin Chitta , Acorn Pooley
autogenerated on Sun Oct 18 2020 13:16:33