Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

base::Trajectory Class Reference

Inheritance diagram for base::Trajectory:

Inheritance graph
[legend]
Collaboration diagram for base::Trajectory:

Collaboration graph
[legend]
List of all members.

Public Types

enum  ExternalizationType { Input = 1, Output = 2, IO = 3 }

Public Member Functions

 Trajectory ()
 default trajectory - all points & times range over [0..1] secs.

 Trajectory (const Trajectory &t)
 copy trajectory t

 Trajectory (const Path &p, Int samples=100)
 Trajectory (const Point3 &sp, const Orient &so, const Time &st, const Point3 &ep, const Orient &eo, const Time &et)
 simple line segment start[position|orientation|time] - end[position|orientation|time]

 Trajectory (const array< Point3 > &points, const array< Orient > &orients=array< Orient >(), const array< Time > &times=array< Time >(), bool deltas=false)
 Trajectory (const array< Vector > &points, bool deltas=false)
 Trajectory (const ExpressionVector &p)
 arbitrary path defined by symbolic expressions for x,y,z,qx,qy,qz,qw,t in terms of s

virtual String className () const
Point3 position (const Time &t) const
 get cartesian position at time t

Orient orientation (const Time &t) const
 get orientation at time t

Time time (Real s) const
 get time at s:[0..1]

void resample (Int samples=100)
 discard distinguished points and replace them by 'samples' distingushed points over s=[0..1]

void resample (const Real dxmax)
 add distinguished points as necessary to ensure that distance between the positions of any pair of distinguished points is <= dxmax

void shiftTime (const Time &dt)
 shift time by dt

void scaleTime (Real s)
 scale time by s

Path toPath () const
 convert to a Path by discarding time information

virtual void serialize (Serializer &s)
 read or write object state to Serializer

virtual bool formatSupported (String format, Real version=1.0, ExternalizationType type=IO) const
 query if specific format is supported (for input, output or both)

virtual void externalize (Externalizer &e, String format="", Real version=1.0)
 read or write object state to Externalizer

Point3 position (Real s) const
 get cartesian position at s:[0..1]

Orient orientation (Real s) const
 get orientation at s:[0..1]

const StringgetCoordFrame () const
void setCoordFrame (const String &coordFrame)
 set application defined coordinate frame specifier.

const StringgetUnits () const
void setUnits (const String &unitSpecifier)
 set application defined unit specifier.

Real distinguishedValue (Int i) const
Int numDistinguishedValues () const
 < number of distinguished s values

void translate (const Vector3 &t)
 translate the path position by t

void rotate (const Quat4 &r)
 rotate the path orientation by r

void transform (const Matrix4 &m)
 transform the path by m

void scalePosition (Real s)
 scale position coords. by s

virtual void externalize (Externalizer &e, String format="", Real version=1.0) const
 write object state to Externalizer (throws if e is in Input)

virtual bool isSameKindAs (const Object &) const
void load (ref< VFile > archive, const String &format="", Real version=1.0)
void save (ref< VFile > archive, const String &format="", Real version=1.0)

Static Public Member Functions

template<class BaseClass, class DerivedClass> void registerSerializableInstantiator (const SerializableInstantiator &instantiator)
void registerSerializableInstantiator (const String &baseClassTypeName, const String &derivedClassTypeName, const SerializableInstantiator &instantiator)
template<class BaseClass> const SerializableInstantiator & getSerializableInstantiator (const String &derivedClassTypeName)
const SerializableInstantiator & getSerializableInstantiator (const String &baseClassTypeName, const String &derivedClassTypeName)

Protected Member Functions

virtual void create ()
virtual void create (const Trajectory &t)
virtual void create (const Point3 &sp, const Orient &so, const Point3 &ep, const Orient &eo)
virtual void create (const Point3 &sp, const Orient &so, const Time &st, const Point3 &ep, const Orient &eo, const Time &et)
virtual void create (const array< Point3 > &points, const array< Orient > &orients, bool deltas)
virtual void create (const array< Point3 > &points, const array< Orient > &orients, const array< Time > &times, bool deltas)
virtual void create (const array< Vector > &points, bool deltas)
virtual void create (const ExpressionVector &p)
void init (const array< Point3 > &points, const array< Orient > &orients, const array< Time > &times, bool deltas)
virtual void create (const Path &p)
void init (const array< Point3 > &points, const array< Orient > &orients, bool deltas)

Protected Attributes

ref< TrajectoryTimeReptrep
 representation

Serializable::SerializableDerivedInstantiator<
LineSegTrajectoryRep
lineSegTrajectoryRepInstantiator
Serializable::SerializableDerivedInstantiator<
WaypointTrajectoryRep
waypointTrajectoryRepInstantiator
Serializable::SerializableDerivedInstantiator<
ParametricTrajectoryRep
parametricTrajectoryRepInstantiator
ref< PathReprep
 representation

String frame
 application defined coord. frame specifier

String units
 application defined unit specifier

Serializable::SerializableDerivedInstantiator<
LineSegPathRep
lineSegPathRepInstantiator
Serializable::SerializableDerivedInstantiator<
WaypointPathRep
waypointPathRepInstantiator

Friends

class Trajectory

Detailed Description

A Trajectory specifies a space-time curve. It is a Path through 6-space (position & orientation) where each point occurs at a specific time.
See also:
base::Path. Note that unlike Path for which the parameter s varies over the path length, instead s:[0..1] varies proportionally over time t:[start-time, end-time].

Definition at line 50 of file Trajectory.


Member Enumeration Documentation

enum base::Externalizable::ExternalizationType [inherited]
 

Enumeration values:
Input 
Output 
IO 

Definition at line 40 of file Externalizable.


Constructor & Destructor Documentation

base::Trajectory::Trajectory  ) 
 

default trajectory - all points & times range over [0..1] secs.

base::Trajectory::Trajectory const Trajectory t  ) 
 

copy trajectory t

base::Trajectory::Trajectory const Path p,
Int  samples = 100
 

copy Path p (times will be in range [0..1] secs) If p has >2 distinguished points, then the trajectory is created by sampling the path at those points, otherwise it is created by dividing the range s:[0..1] into the no. of

base::Trajectory::Trajectory const Point3 sp,
const Orient so,
const Time st,
const Point3 ep,
const Orient eo,
const Time et
 

simple line segment start[position|orientation|time] - end[position|orientation|time]

base::Trajectory::Trajectory const array< Point3 > &  points,
const array< Orient > &  orients = array< Orient >(),
const array< Time > &  times = array< Time >(),
bool  deltas = false
 

a set of 'waypoints' - actually points and their corresponding orientations & times. if deltas is true, the arrays are considered to specify the inter-waypoint deltas instead (with the first point/orient being 0)

base::Trajectory::Trajectory const array< Vector > &  points,
bool  deltas = false
 

a set of 'waypoints'. If vector dim is 4, specifies position & time only; dim 7, specifies position and orientation using the EulerRPY (roll, pitch, yaw) convention & time; dim 8 specifies position and orientation as a quaternion qx,qy,qz,qw & time (secs). if deltas is true, the array is considered to specify the inter-waypoint deltas instead (with the first point/orient/time being 0)

base::Trajectory::Trajectory const ExpressionVector p  ) 
 

arbitrary path defined by symbolic expressions for x,y,z,qx,qy,qz,qw,t in terms of s


Member Function Documentation

virtual String base::Trajectory::className  )  const [inline, virtual]
 

return the name of the object's class type. Must be defined by derived classes.

Reimplemented from base::Path.

Definition at line 85 of file Trajectory.

References base::String.

virtual void base::Path::create const Path p  )  [protected, virtual, inherited]
 

virtual void base::Trajectory::create const ExpressionVector p  )  [protected, virtual]
 

Reimplemented from base::Path.

virtual void base::Trajectory::create const array< Vector > &  points,
bool  deltas
[protected, virtual]
 

Reimplemented from base::Path.

virtual void base::Trajectory::create const array< Point3 > &  points,
const array< Orient > &  orients,
const array< Time > &  times,
bool  deltas
[protected, virtual]
 

virtual void base::Trajectory::create const array< Point3 > &  points,
const array< Orient > &  orients,
bool  deltas
[protected, virtual]
 

Reimplemented from base::Path.

virtual void base::Trajectory::create const Point3 sp,
const Orient so,
const Time st,
const Point3 ep,
const Orient eo,
const Time et
[protected, virtual]
 

virtual void base::Trajectory::create const Point3 sp,
const Orient so,
const Point3 ep,
const Orient eo
[protected, virtual]
 

Reimplemented from base::Path.

virtual void base::Trajectory::create const Trajectory t  )  [protected, virtual]
 

virtual void base::Trajectory::create  )  [protected, virtual]
 

Reimplemented from base::Path.

Real base::Path::distinguishedValue Int  i  )  const [inline, inherited]
 

some values of s may correspond to distinguished points along a path. the values s=0 and s=1 are always distinguished values. For example, if the path was specified using waypoints, then there will be a distinguished value of s for each waypoint. 0 <= i < numDistinguishedValues()

Definition at line 114 of file Path.

References base::Int, and base::Real.

virtual void base::Externalizable::externalize Externalizer e,
String  format = "",
Real  version = 1.0
const [virtual, inherited]
 

write object state to Externalizer (throws if e is in Input)

Reimplemented in physics::Box, physics::Capsule, physics::Cone, physics::Cylinder, physics::LODTerrain, physics::Polyhedron, physics::Sphere, robot::KinematicChain::Link, robot::KinematicChain, robot::ManipulatorDescription, robot::PlatformDescription, robot::RobotDescription, robot::sim::SimulatedManipulatorDescription, robot::sim::SimulatedRobotDescription, robot::sim::SimulatedSerialManipulator, robot::sim::SimulatedTool, and robot::ToolDescription.

virtual void base::Trajectory::externalize Externalizer e,
String  format = "",
Real  version = 1.0
[virtual]
 

read or write object state to Externalizer

Reimplemented from base::Path.

virtual bool base::Trajectory::formatSupported String  format,
Real  version = 1.0,
ExternalizationType  type = IO
const [virtual]
 

query if specific format is supported (for input, output or both)

Reimplemented from base::Path.

const String& base::Path::getCoordFrame  )  const [inline, inherited]
 

get application defined coordinate frame specifier. Some means of creating a Path provide a coordinate frame specifier. e.g. xml externalization this returns that string (or whatever was set via setCoordFrame() - defaults to the empty String)

Definition at line 95 of file Path.

References base::Path::frame, and base::String.

const SerializableInstantiator& base::Serializable::getSerializableInstantiator const String baseClassTypeName,
const String derivedClassTypeName
[static, inherited]
 

template<class BaseClass>
const SerializableInstantiator& base::Serializable::getSerializableInstantiator const String derivedClassTypeName  )  [inline, static, inherited]
 

Definition at line 71 of file Serializable.

References base::String.

const String& base::Path::getUnits  )  const [inline, inherited]
 

get application defined unit specifier. Some means of creating a Path provide unit specifier. e.g. xml externalization this returns that string (or whatever was set via setUnits() - defaults to the empty String)

Definition at line 104 of file Path.

References base::String, and base::Path::units.

void base::Path::init const array< Point3 > &  points,
const array< Orient > &  orients,
bool  deltas
[protected, inherited]
 

void base::Trajectory::init const array< Point3 > &  points,
const array< Orient > &  orients,
const array< Time > &  times,
bool  deltas
[protected]
 

virtual bool base::Object::isSameKindAs const Object  )  const [inline, virtual, inherited]
 

Definition at line 47 of file Object.

void base::Externalizable::load ref< VFile archive,
const String format = "",
Real  version = 1.0
[inherited]
 

Int base::Path::numDistinguishedValues  )  const [inline, inherited]
 

< number of distinguished s values

Definition at line 116 of file Path.

References base::Int.

Orient base::Path::orientation Real  s  )  const [inline, inherited]
 

get orientation at s:[0..1]

Definition at line 84 of file Path.

References base::Real.

Orient base::Trajectory::orientation const Time t  )  const [inline]
 

get orientation at time t

Definition at line 91 of file Trajectory.

References trep.

Point3 base::Path::position Real  s  )  const [inline, inherited]
 

get cartesian position at s:[0..1]

Definition at line 81 of file Path.

References base::Point3, and base::Real.

Point3 base::Trajectory::position const Time t  )  const [inline]
 

get cartesian position at time t

Definition at line 88 of file Trajectory.

References base::Point3, and trep.

void base::Serializable::registerSerializableInstantiator const String baseClassTypeName,
const String derivedClassTypeName,
const SerializableInstantiator instantiator
[static, inherited]
 

template<class BaseClass, class DerivedClass>
void base::Serializable::registerSerializableInstantiator const SerializableInstantiator instantiator  )  [inline, static, inherited]
 

Definition at line 62 of file Serializable.

void base::Trajectory::resample const Real  dxmax  ) 
 

add distinguished points as necessary to ensure that distance between the positions of any pair of distinguished points is <= dxmax

Reimplemented from base::Path.

void base::Trajectory::resample Int  samples = 100  ) 
 

discard distinguished points and replace them by 'samples' distingushed points over s=[0..1]

Reimplemented from base::Path.

void base::Path::rotate const Quat4 r  )  [inline, inherited]
 

rotate the path orientation by r

Definition at line 123 of file Path.

void base::Externalizable::save ref< VFile archive,
const String format = "",
Real  version = 1.0
[inherited]
 

void base::Path::scalePosition Real  s  )  [inline, inherited]
 

scale position coords. by s

Definition at line 129 of file Path.

References base::Real.

void base::Trajectory::scaleTime Real  s  )  [inline]
 

scale time by s

Definition at line 106 of file Trajectory.

References base::Real, and trep.

virtual void base::Trajectory::serialize Serializer s  )  [virtual]
 

read or write object state to Serializer

Reimplemented from base::Path.

void base::Path::setCoordFrame const String coordFrame  )  [inline, inherited]
 

set application defined coordinate frame specifier.

Definition at line 98 of file Path.

References base::Path::frame, and base::String.

void base::Path::setUnits const String unitSpecifier  )  [inline, inherited]
 

set application defined unit specifier.

Definition at line 107 of file Path.

References base::String, and base::Path::units.

void base::Trajectory::shiftTime const Time dt  )  [inline]
 

shift time by dt

Definition at line 103 of file Trajectory.

References trep.

Time base::Trajectory::time Real  s  )  const [inline]
 

get time at s:[0..1]

Definition at line 94 of file Trajectory.

References base::Real, and trep.

Path base::Trajectory::toPath  )  const
 

convert to a Path by discarding time information

void base::Path::transform const Matrix4 m  )  [inline, inherited]
 

transform the path by m

Definition at line 126 of file Path.

void base::Path::translate const Vector3 t  )  [inline, inherited]
 

translate the path position by t

Definition at line 120 of file Path.


Friends And Related Function Documentation

friend class Trajectory [friend, inherited]
 

Definition at line 156 of file Path.


Member Data Documentation

String base::Path::frame [protected, inherited]
 

application defined coord. frame specifier

Definition at line 147 of file Path.

Referenced by base::Path::getCoordFrame(), and base::Path::setCoordFrame().

Serializable::SerializableDerivedInstantiator<LineSegPathRep> base::Path::lineSegPathRepInstantiator [protected, inherited]
 

Definition at line 153 of file Path.

Serializable::SerializableDerivedInstantiator<LineSegTrajectoryRep> base::Trajectory::lineSegTrajectoryRepInstantiator [protected]
 

Definition at line 134 of file Trajectory.

Serializable::SerializableDerivedInstantiator<ParametricTrajectoryRep> base::Trajectory::parametricTrajectoryRepInstantiator [protected]
 

Definition at line 136 of file Trajectory.

ref<PathRep> base::Path::rep [protected, inherited]
 

representation

Definition at line 146 of file Path.

ref<TrajectoryTimeRep> base::Trajectory::trep [protected]
 

representation

Definition at line 129 of file Trajectory.

Referenced by orientation(), position(), scaleTime(), shiftTime(), and time().

String base::Path::units [protected, inherited]
 

application defined unit specifier

Definition at line 148 of file Path.

Referenced by base::Path::getUnits(), and base::Path::setUnits().

Serializable::SerializableDerivedInstantiator<WaypointPathRep> base::Path::waypointPathRepInstantiator [protected, inherited]
 

Definition at line 154 of file Path.

Serializable::SerializableDerivedInstantiator<WaypointTrajectoryRep> base::Trajectory::waypointTrajectoryRepInstantiator [protected]
 

Definition at line 135 of file Trajectory.


The documentation for this class was generated from the following file:
Generated on Thu Jul 29 16:39:25 2004 for OpenSim by doxygen 1.3.6