openrave.org

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
cppexamples::CustomController Class Reference
Inheritance diagram for cppexamples::CustomController:
Inheritance graph
[legend]
Collaboration diagram for cppexamples::CustomController:
Collaboration graph
[legend]

Classes

class  PIDXMLReader
 
class  XMLData
 

Public Member Functions

 CustomController (EnvironmentBasePtr penv)
 
virtual ~CustomController ()
 
virtual bool Init (RobotBasePtr robot, const std::vector< int > &dofindices, int nControlTransformation)
 initializes the controller and specifies the controlled dof
 
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 void Reset (int options)
 Resets the current controller trajectories and any other state associated with the robot.
 
virtual bool SetDesired (const std::vector< dReal > &values, TransformConstPtr trans)
 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 ()
 Return true when goal reached.
 
virtual dReal GetTime () const
 return the time along the current command
 
virtual RobotBasePtr GetRobot () const
 
- Public Member Functions inherited from OpenRAVE::ControllerBase
 ControllerBase (EnvironmentBasePtr penv)
 
virtual ~ControllerBase ()
 
virtual void GetVelocity (std::vector< dReal > &vel) const OPENRAVE_DUMMY_IMPLEMENTATION
 get velocity of the controlled DOFs
 
virtual void GetTorque (std::vector< dReal > &torque) const OPENRAVE_DUMMY_IMPLEMENTATION
 
- Public Member Functions inherited from OpenRAVE::InterfaceBase
 InterfaceBase (InterfaceType type, EnvironmentBasePtr penv)
 
virtual ~InterfaceBase ()
 
InterfaceType GetInterfaceType () const
 
const std::string & GetXMLId () const
 
const std::string & GetPluginName () const
 
EnvironmentBasePtr GetEnv () const
 
const READERSMAPGetReadableInterfaces () 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
 

Static Public Member Functions

static BaseXMLReaderPtr CreateXMLReader (InterfaceBasePtr ptr, const AttributesList &atts)
 
- Static Public Member Functions inherited from OpenRAVE::ControllerBase
static InterfaceType GetInterfaceTypeStatic ()
 return the static interface type this class points to (used for safe casting)
 

Protected Attributes

RobotBasePtr _probot
 
std::vector< int > _dofindices
 
int _nControlTransformation
 

Additional Inherited Members

- Public Types inherited from OpenRAVE::InterfaceBase
typedef std::map< std::string,
XMLReadablePtr,
CaseInsensitiveCompare
READERSMAP
 
- Protected Types inherited from OpenRAVE::InterfaceBase
typedef boost::function< bool(std::ostream
&, std::istream &)> 
InterfaceCommandFn
 The function to be executed for every command.
 
- Protected Member Functions inherited from OpenRAVE::InterfaceBase
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
 

Detailed Description

Examples:
customreader.cpp.

Definition at line 16 of file customreader.cpp.

Constructor & Destructor Documentation

cppexamples::CustomController::CustomController ( EnvironmentBasePtr  penv)
inline

Definition at line 81 of file customreader.cpp.

virtual cppexamples::CustomController::~CustomController ( )
inlinevirtual

Definition at line 84 of file customreader.cpp.

Member Function Documentation

static BaseXMLReaderPtr cppexamples::CustomController::CreateXMLReader ( InterfaceBasePtr  ptr,
const AttributesList atts 
)
inlinestatic
Examples:
customreader.cpp.

Definition at line 75 of file customreader.cpp.

virtual const std::vector<int>& cppexamples::CustomController::GetControlDOFIndices ( ) const
inlinevirtual

returns the dof indices controlled

Implements OpenRAVE::ControllerBase.

Definition at line 111 of file customreader.cpp.

virtual RobotBasePtr cppexamples::CustomController::GetRobot ( ) const
inlinevirtual

Implements OpenRAVE::ControllerBase.

Definition at line 134 of file customreader.cpp.

virtual dReal cppexamples::CustomController::GetTime ( ) const
inlinevirtual

return the time along the current command

Reimplemented from OpenRAVE::ControllerBase.

Definition at line 131 of file customreader.cpp.

virtual bool cppexamples::CustomController::Init ( RobotBasePtr  robot,
const std::vector< int > &  dofindices,
int  nControlTransformation 
)
inlinevirtual

initializes the controller and specifies the controlled dof

Parameters
robotthe robot that uses the controller
dofindicesthe indices that controller will have exclusive access to
nControlTransformation
See Also
IsControlTransformation
Returns
true on successful initialization

Implements OpenRAVE::ControllerBase.

Definition at line 87 of file customreader.cpp.

virtual int cppexamples::CustomController::IsControlTransformation ( ) const
inlinevirtual

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 114 of file customreader.cpp.

virtual bool cppexamples::CustomController::IsDone ( )
inlinevirtual

Return true when goal reached.

If a trajectory was set, return only when trajectory is done. If SetDesired was called, return only when robot is is at the desired location. If SendCommand sent, returns true when the command was completed by the hand.

Implements OpenRAVE::ControllerBase.

Definition at line 128 of file customreader.cpp.

virtual void cppexamples::CustomController::Reset ( int  options)
inlinevirtual

Resets the current controller trajectories and any other state associated with the robot.

Parameters
options- specific options that can be used to control what to reset

Implements OpenRAVE::ControllerBase.

Definition at line 118 of file customreader.cpp.

virtual bool cppexamples::CustomController::SetDesired ( const std::vector< dReal > &  values,
TransformConstPtr  trans 
)
inlinevirtual

go to a specific position in configuration space. [multi-thread safe]

Parameters
valuesthe final configuration in the control dofs
transthe transformation of the base. If not specified will use the current robot transformation. Ignored if controller does not use it
Returns
true if position operation successful.

Implements OpenRAVE::ControllerBase.

Definition at line 120 of file customreader.cpp.

virtual bool cppexamples::CustomController::SetPath ( TrajectoryBaseConstPtr  ptraj)
inlinevirtual

Follow a path in configuration space, adds to the queue of trajectories already in execution. [multi-thread safe]

Parameters
ptraj- the trajectory
Returns
true if trajectory operation successful

Implements OpenRAVE::ControllerBase.

Definition at line 123 of file customreader.cpp.

virtual void cppexamples::CustomController::SimulationStep ( dReal  fTimeElapsed)
inlinevirtual

Simulate one step forward for controllers running in the simulation environment.

Parameters
fTimeElapsed- time elapsed in simulation environment since last frame

Implements OpenRAVE::ControllerBase.

Definition at line 126 of file customreader.cpp.

Member Data Documentation

std::vector<int> cppexamples::CustomController::_dofindices
protected

Definition at line 140 of file customreader.cpp.

int cppexamples::CustomController::_nControlTransformation
protected

Definition at line 141 of file customreader.cpp.

RobotBasePtr cppexamples::CustomController::_probot
protected

Definition at line 139 of file customreader.cpp.


The documentation for this class was generated from the following file: