openrave.org

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
OpenRAVE::TrajectoryBase Class Referenceabstract

[interface] Encapsulate a time-parameterized trajectories of robot configurations. If not specified, method is not multi-thread safe. Trajectory Concepts More...

#include <trajectory.h>

Inheritance diagram for OpenRAVE::TrajectoryBase:
Inheritance graph
[legend]
Collaboration diagram for OpenRAVE::TrajectoryBase:
Collaboration graph
[legend]

Classes

class  Point
 

Public Types

typedef Point TPOINT RAVE_DEPRECATED
 
- Public Types inherited from OpenRAVE::InterfaceBase
typedef std::map< std::string,
XMLReadablePtr,
CaseInsensitiveCompare
READERSMAP
 

Public Member Functions

 TrajectoryBase (EnvironmentBasePtr penv)
 
virtual ~TrajectoryBase ()
 
virtual void Init (const ConfigurationSpecification &spec)=0
 
virtual void Insert (size_t index, const std::vector< dReal > &data, bool bOverwrite=false)=0
 Sets/inserts new waypoints in the same configuration specification as the trajectory.
 
virtual void Insert (size_t index, const std::vector< dReal > &data, const ConfigurationSpecification &spec, bool bOverwrite=false)=0
 Sets/inserts new waypoints in a user-given configuration specification.
 
virtual void Remove (size_t startindex, size_t endindex)=0
 removes a number of waypoints starting at the specified index
 
virtual void Sample (std::vector< dReal > &data, dReal time) const =0
 samples a data point on the trajectory at a particular time
 
virtual void Sample (std::vector< dReal > &data, dReal time, const ConfigurationSpecification &spec) const
 samples a data point on the trajectory at a particular time and returns data for the group specified.
 
virtual const
ConfigurationSpecification
GetConfigurationSpecification () const =0
 
virtual size_t GetNumWaypoints () const =0
 return the number of waypoints
 
virtual void GetWaypoints (size_t startindex, size_t endindex, std::vector< dReal > &data) const =0
 return a set of waypoints in the range [startindex,endindex)
 
virtual void GetWaypoints (size_t startindex, size_t endindex, std::vector< dReal > &data, const ConfigurationSpecification &spec) const
 return a set of waypoints in the range [startindex,endindex) in a different configuration specification.
 
void GetWaypoint (int index, std::vector< dReal > &data) const
 returns one waypoint
 
void GetWaypoint (int index, std::vector< dReal > &data, const ConfigurationSpecification &spec) const
 returns one waypoint
 
virtual dReal GetDuration () const =0
 return the duration of the trajectory in seconds
 
virtual void serialize (std::ostream &O, int options=0) const
 output the trajectory in XML format
 
virtual InterfaceBasePtr deserialize (std::istream &I)
 initialize the trajectory
 
virtual void Clone (InterfaceBaseConstPtr preference, int cloningoptions)
 Clone the contents of an interface to the current interface.
 
virtual bool SampleTrajectory (dReal time, Point &tp) const RAVE_DEPRECATED
 
virtual const std::vector
< Point > & 
GetPoints () const RAVE_DEPRECATED
 
int GetDOF () const RAVE_DEPRECATED
 
virtual dReal GetTotalDuration () const RAVE_DEPRECATED
 
virtual bool Write (std::ostream &O, int options) const RAVE_DEPRECATED
 
virtual bool Read (std::istream &I, RobotBaseConstPtr) RAVE_DEPRECATED
 
virtual int GetInterpMethod () const RAVE_DEPRECATED
 
virtual bool CalcTrajTiming (RobotBasePtr probot, int interp, bool autocalc, bool activedof, dReal fmaxvelmult=1) RAVE_DEPRECATED
 
virtual void Clear () RAVE_DEPRECATED
 
virtual void AddPoint (const Point &p) RAVE_DEPRECATED
 
virtual void Reset (int dof) RAVE_DEPRECATED
 
- 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 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 InterfaceType GetInterfaceTypeStatic ()
 return the static interface type this class points to (used for safe casting)
 

Static Public Attributes

static const int TO_OneLine RAVE_DEPRECATED = 1
 
static const int TO_NoHeader RAVE_DEPRECATED = 2
 
static const int
TO_IncludeTimestamps 
RAVE_DEPRECATED = 4
 
static const int
TO_IncludeBaseTransformation 
RAVE_DEPRECATED = 8
 
static const int
TO_IncludeVelocities 
RAVE_DEPRECATED = 0x10
 
static const int TO_IncludeTorques RAVE_DEPRECATED = 0x20
 
static const int
TO_InterpolationMask 
RAVE_DEPRECATED = 0x1c0
 
static const int NONE RAVE_DEPRECATED = 0
 
static const int LINEAR RAVE_DEPRECATED = 1
 
static const int LINEAR_BLEND RAVE_DEPRECATED = 2
 
static const int CUBIC RAVE_DEPRECATED = 3
 
static const int QUINTIC RAVE_DEPRECATED = 4
 
static const int NUM_METHODS RAVE_DEPRECATED = 5
 

Protected Member Functions

TrajectoryBasePtr shared_trajectory ()
 
TrajectoryBaseConstPtr shared_trajectory_const () const
 
- 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
 

Additional Inherited Members

- Protected Types inherited from OpenRAVE::InterfaceBase
typedef boost::function< bool(std::ostream
&, std::istream &)> 
InterfaceCommandFn
 The function to be executed for every command.
 
- Protected Attributes inherited from OpenRAVE::InterfaceBase
std::string __description
 

Detailed Description

[interface] Encapsulate a time-parameterized trajectories of robot configurations. If not specified, method is not multi-thread safe. Trajectory Concepts

Definition at line 30 of file trajectory.h.

Member Typedef Documentation

Deprecated:
(11/10/04)

Definition at line 166 of file trajectory.h.

Constructor & Destructor Documentation

OpenRAVE::TrajectoryBase::TrajectoryBase ( EnvironmentBasePtr  penv)

Definition at line 24 of file trajectory.cpp.

virtual OpenRAVE::TrajectoryBase::~TrajectoryBase ( )
inlinevirtual

Definition at line 34 of file trajectory.h.

Member Function Documentation

void OpenRAVE::TrajectoryBase::AddPoint ( const Point p)
virtual
Deprecated:
(11/10/04)

Definition at line 157 of file trajectory.cpp.

bool OpenRAVE::TrajectoryBase::CalcTrajTiming ( RobotBasePtr  probot,
int  interp,
bool  autocalc,
bool  activedof,
dReal  fmaxvelmult = 1 
)
virtual
virtual void OpenRAVE::TrajectoryBase::Clear ( )
inlinevirtual
Deprecated:
(11/10/04)

Definition at line 206 of file trajectory.h.

void OpenRAVE::TrajectoryBase::Clone ( InterfaceBaseConstPtr  preference,
int  cloningoptions 
)
virtual

Clone the contents of an interface to the current interface.

Parameters
preferencethe interface whose information to clone
cloningoptionsmask of CloningOptions
Exceptions
openrave_exceptionif command doesn't succeed

Reimplemented from OpenRAVE::InterfaceBase.

Definition at line 75 of file trajectory.cpp.

InterfaceBasePtr OpenRAVE::TrajectoryBase::deserialize ( std::istream &  I)
virtual

initialize the trajectory

Definition at line 52 of file trajectory.cpp.

virtual const ConfigurationSpecification& OpenRAVE::TrajectoryBase::GetConfigurationSpecification ( ) const
pure virtual
int OpenRAVE::TrajectoryBase::GetDOF ( ) const
inline
Deprecated:
(11/10/04) use GetConfigurationSpecification().GetDOF()

Definition at line 175 of file trajectory.h.

virtual dReal OpenRAVE::TrajectoryBase::GetDuration ( ) const
pure virtual

return the duration of the trajectory in seconds

static InterfaceType OpenRAVE::TrajectoryBase::GetInterfaceTypeStatic ( )
inlinestatic

return the static interface type this class points to (used for safe casting)

Definition at line 38 of file trajectory.h.

virtual int OpenRAVE::TrajectoryBase::GetInterpMethod ( ) const
inlinevirtual
Deprecated:
(11/10/04)

Definition at line 198 of file trajectory.h.

virtual size_t OpenRAVE::TrajectoryBase::GetNumWaypoints ( ) const
pure virtual

return the number of waypoints

const std::vector< TrajectoryBase::Point > & OpenRAVE::TrajectoryBase::GetPoints ( ) const
virtual
Deprecated:
(11/10/04) use GetWaypoints

Definition at line 123 of file trajectory.cpp.

virtual dReal OpenRAVE::TrajectoryBase::GetTotalDuration ( ) const
inlinevirtual
Deprecated:
(11/10/04) see GetDuration()

Definition at line 180 of file trajectory.h.

void OpenRAVE::TrajectoryBase::GetWaypoint ( int  index,
std::vector< dReal > &  data 
) const
inline

returns one waypoint

Parameters
index[in]index of the waypoint. If < 0, then counting starts from the last waypoint. For example GetWaypoints(-1,data) returns the last waypoint.
data[out]the data of the waypoint

Definition at line 108 of file trajectory.h.

void OpenRAVE::TrajectoryBase::GetWaypoint ( int  index,
std::vector< dReal > &  data,
const ConfigurationSpecification spec 
) const
inline

returns one waypoint

Parameters
index[in]index of the waypoint. If < 0, then counting starts from the last waypoint. For example GetWaypoints(-1,data) returns the last waypoint.
data[out]the data of the waypoint

Definition at line 123 of file trajectory.h.

virtual void OpenRAVE::TrajectoryBase::GetWaypoints ( size_t  startindex,
size_t  endindex,
std::vector< dReal > &  data 
) const
pure virtual

return a set of waypoints in the range [startindex,endindex)

Parameters
startindex[in]the start index of the waypoint (included)
endindex[in]the end index of the waypoint (not included)
data[out]the data of the waypoint
void OpenRAVE::TrajectoryBase::GetWaypoints ( size_t  startindex,
size_t  endindex,
std::vector< dReal > &  data,
const ConfigurationSpecification spec 
) const
virtual

return a set of waypoints in the range [startindex,endindex) in a different configuration specification.

The default implementation is very slow, so trajectory developers should really override it.

Parameters
startindex[in]the start index of the waypoint (included)
endindex[in]the end index of the waypoint (not included)
spec[in]the specification to return the data in
data[out]the data of the waypoint

Definition at line 94 of file trajectory.cpp.

virtual void OpenRAVE::TrajectoryBase::Init ( const ConfigurationSpecification spec)
pure virtual
virtual void OpenRAVE::TrajectoryBase::Insert ( size_t  index,
const std::vector< dReal > &  data,
bool  bOverwrite = false 
)
pure virtual

Sets/inserts new waypoints in the same configuration specification as the trajectory.

Parameters
indexThe index where to start modifying the trajectory.
dataThe data to insert, can represent multiple consecutive waypoints. data.size()/GetConfigurationSpecification().GetDOF() waypoints are added.
bOverwriteIf true, will overwrite the waypoints starting at index, and will insert new waypoints only if end of trajectory is reached. If false, will insert the points before index: a 0 index inserts the new data in the beginning, a GetNumWaypoints() index inserts the new data at the end.
virtual void OpenRAVE::TrajectoryBase::Insert ( size_t  index,
const std::vector< dReal > &  data,
const ConfigurationSpecification spec,
bool  bOverwrite = false 
)
pure virtual

Sets/inserts new waypoints in a user-given configuration specification.

Parameters
indexThe index where to start modifying the trajectory.
dataThe data to insert, can represent multiple consecutive waypoints. data.size()/GetConfigurationSpecification().GetDOF() waypoints are added.
specthe specification in which the input data come in. Depending on what data is offered, some values of this trajectory's specification might not be initialized.
bOverwriteIf true, will overwrite the waypoints starting at index, and will insert new waypoints only if end of trajectory is reached; if the input spec does not overwrite all the data of the trjectory spec, then the original trajectory data will not be overwritten. If false, will insert the points before index: a 0 index inserts the new data in the beginning, a GetNumWaypoints() index inserts the new data at the end.
virtual bool OpenRAVE::TrajectoryBase::Read ( std::istream &  I,
RobotBaseConstPtr   
)
inlinevirtual
Deprecated:
(11/10/04) see deserialize

Definition at line 192 of file trajectory.h.

virtual void OpenRAVE::TrajectoryBase::Remove ( size_t  startindex,
size_t  endindex 
)
pure virtual

removes a number of waypoints starting at the specified index

virtual void OpenRAVE::TrajectoryBase::Reset ( int  dof)
inlinevirtual
Deprecated:
(11/10/04)

Definition at line 215 of file trajectory.h.

virtual void OpenRAVE::TrajectoryBase::Sample ( std::vector< dReal > &  data,
dReal  time 
) const
pure virtual

samples a data point on the trajectory at a particular time

Parameters
data[out]the sampled point
time[in]the time to sample
void OpenRAVE::TrajectoryBase::Sample ( std::vector< dReal > &  data,
dReal  time,
const ConfigurationSpecification spec 
) const
virtual

samples a data point on the trajectory at a particular time and returns data for the group specified.

The default implementation is slow, so interface developers should override it.

Parameters
data[out]the sampled point
time[in]the time to sample
spec[in]the specification format to return the data in

Definition at line 85 of file trajectory.cpp.

bool OpenRAVE::TrajectoryBase::SampleTrajectory ( dReal  time,
TrajectoryBase::Point tp 
) const
virtual
Deprecated:
(11/10/04) see Sample

Definition at line 107 of file trajectory.cpp.

void OpenRAVE::TrajectoryBase::serialize ( std::ostream &  O,
int  options = 0 
) const
virtual

output the trajectory in XML format

Definition at line 28 of file trajectory.cpp.

TrajectoryBasePtr OpenRAVE::TrajectoryBase::shared_trajectory ( )
inlineprotected

Definition at line 236 of file trajectory.h.

TrajectoryBaseConstPtr OpenRAVE::TrajectoryBase::shared_trajectory_const ( ) const
inlineprotected

Definition at line 239 of file trajectory.h.

virtual bool OpenRAVE::TrajectoryBase::Write ( std::ostream &  O,
int  options 
) const
inlinevirtual
Deprecated:
(11/10/04) see serialize

Definition at line 186 of file trajectory.h.

Member Data Documentation

const int TO_OneLine OpenRAVE::TrajectoryBase::RAVE_DEPRECATED = 1
static
Deprecated:
(11/10/04)

Definition at line 221 of file trajectory.h.

const int TO_NoHeader OpenRAVE::TrajectoryBase::RAVE_DEPRECATED = 2
static

Definition at line 222 of file trajectory.h.

const int TO_IncludeTimestamps OpenRAVE::TrajectoryBase::RAVE_DEPRECATED = 4
static

Definition at line 223 of file trajectory.h.

const int TO_IncludeBaseTransformation OpenRAVE::TrajectoryBase::RAVE_DEPRECATED = 8
static

Definition at line 224 of file trajectory.h.

const int TO_IncludeVelocities OpenRAVE::TrajectoryBase::RAVE_DEPRECATED = 0x10
static

Definition at line 225 of file trajectory.h.

const int TO_IncludeTorques OpenRAVE::TrajectoryBase::RAVE_DEPRECATED = 0x20
static

Definition at line 226 of file trajectory.h.

const int TO_InterpolationMask OpenRAVE::TrajectoryBase::RAVE_DEPRECATED = 0x1c0
static

Definition at line 227 of file trajectory.h.

const int NONE OpenRAVE::TrajectoryBase::RAVE_DEPRECATED = 0
static

Definition at line 228 of file trajectory.h.

const int LINEAR OpenRAVE::TrajectoryBase::RAVE_DEPRECATED = 1
static

Definition at line 229 of file trajectory.h.

const int LINEAR_BLEND OpenRAVE::TrajectoryBase::RAVE_DEPRECATED = 2
static

Definition at line 230 of file trajectory.h.

const int CUBIC OpenRAVE::TrajectoryBase::RAVE_DEPRECATED = 3
static

Definition at line 231 of file trajectory.h.

const int QUINTIC OpenRAVE::TrajectoryBase::RAVE_DEPRECATED = 4
static

Definition at line 232 of file trajectory.h.

const int NUM_METHODS OpenRAVE::TrajectoryBase::RAVE_DEPRECATED = 5
static

Definition at line 233 of file trajectory.h.


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