controller that manage multiple controllers, allows users to easily set multiple controllers for one robot. More...
#include <controller.h>
Public Member Functions | |
MultiController (EnvironmentBasePtr penv) | |
virtual | ~MultiController () |
virtual bool | Init (RobotBasePtr robot, const std::vector< int > &dofindices, int nControlTransformation) |
removes all controllers. [multi-thread safe] | |
virtual const std::vector< int > & | GetControlDOFIndices () const |
returns the dof indices controlled | |
virtual int | IsControlTransformation () const |
returns non-zero value if base affine transformation is controlled. | |
virtual RobotBasePtr | GetRobot () const |
virtual bool | AttachController (ControllerBasePtr controller, const std::vector< int > &dofindices, int nControlTransformation) |
initializes and adds a controller, must be called after being initialized. [multi-thread safe] | |
virtual void | RemoveController (ControllerBasePtr controller) |
removes a controller from being managed. [multi-thread safe] | |
virtual ControllerBasePtr | GetController (int dof) const |
gets the controller responsible for dof (in the robot). If dof < 0, returns the transform controller. [multi-thread safe] | |
virtual void | Reset (int options=0) |
Resets the current controller trajectories and any other state associated with the robot. | |
virtual bool | SetDesired (const std::vector< dReal > &values, TransformConstPtr trans=TransformConstPtr()) |
go to a specific position in configuration space. [multi-thread safe] | |
virtual bool | SetPath (TrajectoryBaseConstPtr ptraj) |
Follow a path in configuration space, adds to the queue of trajectories already in execution. [multi-thread safe] | |
virtual void | SimulationStep (dReal fTimeElapsed) |
Simulate one step forward for controllers running in the simulation environment. | |
virtual bool | IsDone () |
returns true only if all controllers return true | |
virtual dReal | GetTime () const |
return the maximum time | |
virtual void | GetVelocity (std::vector< dReal > &vel) const |
get velocity of the controlled DOFs | |
virtual void | GetTorque (std::vector< dReal > &torque) const |
![]() | |
ControllerBase (EnvironmentBasePtr penv) | |
virtual | ~ControllerBase () |
![]() | |
InterfaceBase (InterfaceType type, EnvironmentBasePtr penv) | |
virtual | ~InterfaceBase () |
InterfaceType | GetInterfaceType () const |
const std::string & | GetXMLId () const |
const std::string & | GetPluginName () const |
EnvironmentBasePtr | GetEnv () const |
const READERSMAP & | GetReadableInterfaces () const |
Returns the raw map reference, this is not multithread safe and the GetInterfaceMutex should be locked before using. | |
virtual XMLReadablePtr | GetReadableInterface (const std::string &xmltag) const |
Returns the readable interface. [multi-thread safe] | |
virtual XMLReadablePtr | SetReadableInterface (const std::string &xmltag, XMLReadablePtr readable) |
Set a new readable interface and return the previously set interface if it exists. [multi-thread safe] | |
virtual const std::string & | GetDescription () const |
Documentation of the interface in reStructuredText format. See Documenting Interfaces. [multi-thread safe] | |
virtual void | SetDescription (const std::string &description) |
sets a description [multi-thread safe] | |
virtual void | SetUserData (const std::string &key, UserDataPtr data) const |
set user data for a specific key. [multi-thread safe] | |
virtual UserDataPtr | GetUserData (const std::string &key=std::string()) const |
return the user custom data [multi-thread safe] | |
virtual bool | RemoveUserData (const std::string &key) const |
removes a user data pointer. if user data pointer does not exist, then return 0, otherwise 1. [multi-thread safe] | |
virtual void | SetUserData (UserDataPtr data) RAVE_DEPRECATED |
virtual const std::string & | GetURI () const |
the URI used to load the interface (sometimes this is not possible if the definition lies inside an environment file). [multi-thread safe] | |
virtual const std::string & | GetXMLFilename () const |
virtual void | Clone (InterfaceBaseConstPtr preference, int cloningoptions) |
Clone the contents of an interface to the current interface. | |
virtual bool | SendCommand (std::ostream &os, std::istream &is) |
Used to send special commands to the interface and receive output. | |
virtual void | Serialize (BaseXMLWriterPtr writer, int options=0) const |
serializes the interface | |
Protected Attributes | |
RobotBasePtr | _probot |
std::vector< int > | _dofindices |
std::vector< int > | _dofreverseindices |
int | _nControlTransformation |
std::list< ControllerBasePtr > | _listcontrollers |
std::vector< ControllerBasePtr > | _vcontrollersbydofs |
ControllerBasePtr | _ptransformcontroller |
TrajectoryBasePtr | _ptraj |
boost::mutex | _mutex |
Additional Inherited Members | |
![]() | |
typedef std::map< std::string, XMLReadablePtr, CaseInsensitiveCompare > | READERSMAP |
![]() | |
static InterfaceType | GetInterfaceTypeStatic () |
return the static interface type this class points to (used for safe casting) | |
![]() | |
typedef boost::function< bool(std::ostream &, std::istream &)> | InterfaceCommandFn |
The function to be executed for every command. | |
![]() | |
virtual void | RegisterCommand (const std::string &cmdname, InterfaceCommandFn fncmd, const std::string &strhelp) |
Registers a command and its help string. [multi-thread safe] | |
virtual void | UnregisterCommand (const std::string &cmdname) |
Unregisters the command. [multi-thread safe] | |
virtual boost::shared_mutex & | GetInterfaceMutex () const |
controller that manage multiple controllers, allows users to easily set multiple controllers for one robot.
The class also make sure individual controllers do not have colliding DOF. It ignores the
Definition at line 121 of file controller.h.
OpenRAVE::MultiController::MultiController | ( | EnvironmentBasePtr | penv | ) |
Definition at line 21 of file controller.cpp.
|
virtual |
Definition at line 25 of file controller.cpp.
|
virtual |
initializes and adds a controller, must be called after being initialized. [multi-thread safe]
controller | the controller to init |
dofindices | robot dof indices to control |
openrave_exception | if the controller dofs interfere with current set dofs, will throw an exception |
Definition at line 63 of file controller.cpp.
|
virtual |
returns the dof indices controlled
Implements OpenRAVE::ControllerBase.
Definition at line 53 of file controller.cpp.
|
virtual |
gets the controller responsible for dof (in the robot). If dof < 0, returns the transform controller. [multi-thread safe]
Definition at line 101 of file controller.cpp.
|
virtual |
Implements OpenRAVE::ControllerBase.
Definition at line 59 of file controller.cpp.
|
virtual |
return the maximum time
Reimplemented from OpenRAVE::ControllerBase.
Definition at line 175 of file controller.cpp.
|
virtual |
get torque/current/strain values
torque | [out] - returns the current torque/current/strain exerted by each of the dofs from outside forces. The feedforward and friction terms should be subtracted out already |
Reimplemented from OpenRAVE::ControllerBase.
Definition at line 211 of file controller.cpp.
|
virtual |
get velocity of the controlled DOFs
vel | [out] - current velocity of robot from the dof |
Reimplemented from OpenRAVE::ControllerBase.
Definition at line 194 of file controller.cpp.
|
virtual |
removes all controllers. [multi-thread safe]
Implements OpenRAVE::ControllerBase.
Definition at line 29 of file controller.cpp.
|
virtual |
returns non-zero value if base affine transformation is controlled.
Only one controller can modify translation and orientation per robot. For now, the two cannot be divided.
Implements OpenRAVE::ControllerBase.
Definition at line 56 of file controller.cpp.
|
virtual |
returns true only if all controllers return true
Implements OpenRAVE::ControllerBase.
Definition at line 165 of file controller.cpp.
|
virtual |
removes a controller from being managed. [multi-thread safe]
Definition at line 87 of file controller.cpp.
|
virtual |
Resets the current controller trajectories and any other state associated with the robot.
options | - specific options that can be used to control what to reset |
Implements OpenRAVE::ControllerBase.
Definition at line 117 of file controller.cpp.
|
virtual |
go to a specific position in configuration space. [multi-thread safe]
values | the final configuration in the control dofs |
trans | the transformation of the base. If not specified will use the current robot transformation. Ignored if controller does not use it |
Implements OpenRAVE::ControllerBase.
Definition at line 125 of file controller.cpp.
|
virtual |
Follow a path in configuration space, adds to the queue of trajectories already in execution. [multi-thread safe]
ptraj | - the trajectory |
Implements OpenRAVE::ControllerBase.
Definition at line 140 of file controller.cpp.
|
virtual |
Simulate one step forward for controllers running in the simulation environment.
fTimeElapsed | - time elapsed in simulation environment since last frame |
Implements OpenRAVE::ControllerBase.
Definition at line 157 of file controller.cpp.
|
protected |
Definition at line 166 of file controller.h.
|
protected |
Definition at line 166 of file controller.h.
|
protected |
Definition at line 168 of file controller.h.
|
mutableprotected |
Definition at line 172 of file controller.h.
|
protected |
Definition at line 167 of file controller.h.
|
protected |
Definition at line 165 of file controller.h.
|
protected |
Definition at line 171 of file controller.h.
|
protected |
Definition at line 170 of file controller.h.
|
protected |
Definition at line 169 of file controller.h.