RobWorkProject  24.5.15-
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
DOMTrajectoryLoader Class Reference

Enables loading in trajectories file specified in the RobWork Trajectory XML format. More...

#include <DOMTrajectoryLoader.hpp>

Classes

class  Initializer
 Utility class which initializes local static variables. More...
 

Public Types

enum  Type { QType = 0 , Vector3DType , Rotation3DType , Transform3DType }
 Enumeration specifying which type of trajectory, that has been loaded. More...
 

Public Member Functions

 DOMTrajectoryLoader (const std::string &filename, const std::string &schemaFileName="")
 Constructs DOMTrajectoryLoader and parser filename. More...
 
 DOMTrajectoryLoader (std::istream &instream, const std::string &schemaFileName="")
 Constract DOMTrajectoryLoader and parser input from instream. More...
 
virtual ~DOMTrajectoryLoader ()
 Destructor.
 
Type getType ()
 Returns the type of the trajectory loaded.
 
rw::trajectory::QTrajectory::Ptr getQTrajectory ()
 Returns trajectory with template type rw::math::Q. More...
 
rw::trajectory::Vector3DTrajectory::Ptr getVector3DTrajectory ()
 Returns trajectory with template type rw::math::Vector3D<> More...
 
rw::trajectory::Rotation3DTrajectory::Ptr getRotation3DTrajectory ()
 Returns trajectory with template type rw::math::Rotation3D<> More...
 
rw::trajectory::Transform3DTrajectory::Ptr getTransform3DTrajectory ()
 Returns trajectory with template type rw::math::Transform3D<> More...
 

Static Public Member Functions

static const std::string & idQTrajectory ()
 Identifier for rw::trajectory::Trajectory<rw::math::Q> in the XML format. More...
 
static const std::string & idV3DTrajectory ()
 Identifier for rw::trajectory::Trajectory<rw::math::Vector3D> in the XML format. More...
 
static const std::string & idR3DTrajectory ()
 Identifier for rw::trajectory::Trajectory<rw::math::Rotation3D> in the XML format. More...
 
static const std::string & idT3DTrajectory ()
 Identifier for rw::trajectory::Trajectory<rw::math::Transform3D> in the XML format. More...
 
static const std::string & idQLinearInterpolator ()
 Identifier for rw::trajectory::LinearInterpolator<rw::math::Q> in the XML format. More...
 
static const std::string & idQCubicSplineInterpolator ()
 Identifier for rw::trajectory::CubicSplineInterpolator<rw::math::Q> in the XML format. More...
 
static const std::string & idV3DLinearInterpolator ()
 Identifier for rw::trajectory::LinearInterpolator<rw::math::Vector3D> in the XML format. More...
 
static const std::string & idV3DCubicSplineInterpolator ()
 Identifier for rw::trajectory::CubicSplineInterpolator<rw::math::Vector3D<> > in the XML format. More...
 
static const std::string & idV3DCircularInterpolator ()
 Identifier for rw::trajectory::CircularInterpolator<rw::math::Vector3D<> > in the XML format. More...
 
static const std::string & idR3DLinearInterpolator ()
 Identifier for rw::trajectory::LinearInterpolator<rw::math::Rotation3D<> > in the XML format. More...
 
static const std::string & idR3DCubicSplineInterpolator ()
 Identifier for rw::trajectory::CubicSplineInterpolator<rw::math::Rotation3D<> > in the XML format. More...
 
static const std::string & idT3DLinearInterpolator ()
 Identifier for rw::trajectory::LinearInterpolator<rw::math::Transform3D<> > in the XML format. More...
 
static const std::string & idT3DCubicSplineInterpolator ()
 Identifier for rw::trajectory::CubicSplineInterpolator<rw::math::Transform3D<> > in the XML format. More...
 
static const std::string & idParabolicBlend ()
 Identifier for rw::trajectory::ParabolicBlend in the XML format. More...
 
static const std::string & idLloydHaywardBlend ()
 Identifier for rw::trajectory::LloydHaywardblend in the XML format. More...
 
static const std::string & idDurationAttribute ()
 Identifier for duration specification for interpolators. More...
 
static const std::string & idStartTimeAttribute ()
 Identifier for duration specification for interpolators. More...
 
static const std::string & idTauAttribute ()
 Identifier for the blend time tau used for blends. More...
 
static const std::string & idKappaAttribute ()
 Identifier for the parameter kappa used in LloydHayward blends. More...
 

Detailed Description

Enables loading in trajectories file specified in the RobWork Trajectory XML format.

The DOMTrajectoryLoader loads in a file containing a trajectory specified according to the rwxml_trajectory.xsd schema. The XML-file can be parsed either with or without schema verification. The schema can either be specified in the XML-file or given as argument to the constructor.

A trajectory can contain either rw::math::Q, rw::math::Vector3D, rw::math::Rotation3D or rw::math::Transform3D elements. If the type of the trajectory in the file in unknown it can be determined using the DOMTrajectoryLoader::getType after loading.

If reading in a trajectory fails an exception is thrown

Member Enumeration Documentation

◆ Type

enum Type

Enumeration specifying which type of trajectory, that has been loaded.

Enumerator
Vector3DType 

rw::trajectory::Trajectory<Q>

Rotation3DType 

rw::trajectory::Trajectory<Vector3D>

Transform3DType 

rw::trajectory::Trajectory<Rotation3D>

rw::trajectory::Trajectory<Transform3D>

Constructor & Destructor Documentation

◆ DOMTrajectoryLoader() [1/2]

DOMTrajectoryLoader ( const std::string &  filename,
const std::string &  schemaFileName = "" 
)

Constructs DOMTrajectoryLoader and parser filename.

It is possible to specify whether to use the default schema which is the default behavior. If a schema is specified in the XML-file or no schema should be used set useDefaultSchema to false.

If reading in the trajectory fails an exception is thrown

Parameters
filename[in] The file to load
schemaFileName[in] Name of the schema to use. If empty it will use the schema specified in the XML-file if available.

◆ DOMTrajectoryLoader() [2/2]

DOMTrajectoryLoader ( std::istream &  instream,
const std::string &  schemaFileName = "" 
)

Constract DOMTrajectoryLoader and parser input from instream.

It is possible to specify whether to use the default schema which is the default behavior. If a schema is specified in the XML-file or no schema should be used set useDefaultSchema to false.

If reading in the trajectory fails an exception is thrown

Parameters
instream[in] The istream to read from
schemaFileName[in] Name of the schema to use. If empty it will use the schema specified in the XML-file if available.

Member Function Documentation

◆ getQTrajectory()

Returns trajectory with template type rw::math::Q.

If the loaded path is not of type Transform3DPath it throws an exception.

Returns
Copy of trajectory

◆ getRotation3DTrajectory()

rw::trajectory::Rotation3DTrajectory::Ptr getRotation3DTrajectory ( )

Returns trajectory with template type rw::math::Rotation3D<>

If the loaded path is not of type Transform3DPath it throws an exception.

Returns
Copy of trajectory

◆ getTransform3DTrajectory()

rw::trajectory::Transform3DTrajectory::Ptr getTransform3DTrajectory ( )

Returns trajectory with template type rw::math::Transform3D<>

If the loaded path is not of type Transform3DPath it throws an exception.

Returns
Copy of trajectory

◆ getVector3DTrajectory()

rw::trajectory::Vector3DTrajectory::Ptr getVector3DTrajectory ( )

Returns trajectory with template type rw::math::Vector3D<>

If the loaded trajectory does not contain this type an exception is thrown.

Returns
Copy of trajectory

◆ idDurationAttribute()

static const std::string& idDurationAttribute ( )
static

Identifier for duration specification for interpolators.

Returns
the identifier.

◆ idKappaAttribute()

static const std::string& idKappaAttribute ( )
static

Identifier for the parameter kappa used in LloydHayward blends.

Returns
the identifier.

◆ idLloydHaywardBlend()

static const std::string& idLloydHaywardBlend ( )
static

Identifier for rw::trajectory::LloydHaywardblend in the XML format.

Returns
the identifier.

◆ idParabolicBlend()

static const std::string& idParabolicBlend ( )
static

Identifier for rw::trajectory::ParabolicBlend in the XML format.

Returns
the identifier.

◆ idQCubicSplineInterpolator()

static const std::string& idQCubicSplineInterpolator ( )
static

Identifier for rw::trajectory::CubicSplineInterpolator<rw::math::Q> in the XML format.

Returns
the identifier.

◆ idQLinearInterpolator()

static const std::string& idQLinearInterpolator ( )
static

Identifier for rw::trajectory::LinearInterpolator<rw::math::Q> in the XML format.

Returns
the identifier.

◆ idQTrajectory()

static const std::string& idQTrajectory ( )
static

Identifier for rw::trajectory::Trajectory<rw::math::Q> in the XML format.

Returns
the identifier.

◆ idR3DCubicSplineInterpolator()

static const std::string& idR3DCubicSplineInterpolator ( )
static

Identifier for rw::trajectory::CubicSplineInterpolator<rw::math::Rotation3D<> > in the XML format.

Returns
the identifier.

◆ idR3DLinearInterpolator()

static const std::string& idR3DLinearInterpolator ( )
static

Identifier for rw::trajectory::LinearInterpolator<rw::math::Rotation3D<> > in the XML format.

Returns
the identifier.

◆ idR3DTrajectory()

static const std::string& idR3DTrajectory ( )
static

Identifier for rw::trajectory::Trajectory<rw::math::Rotation3D> in the XML format.

Returns
the identifier.

◆ idStartTimeAttribute()

static const std::string& idStartTimeAttribute ( )
static

Identifier for duration specification for interpolators.

Returns
the identifier.

◆ idT3DCubicSplineInterpolator()

static const std::string& idT3DCubicSplineInterpolator ( )
static

Identifier for rw::trajectory::CubicSplineInterpolator<rw::math::Transform3D<> > in the XML format.

Returns
the identifier.

◆ idT3DLinearInterpolator()

static const std::string& idT3DLinearInterpolator ( )
static

Identifier for rw::trajectory::LinearInterpolator<rw::math::Transform3D<> > in the XML format.

Returns
the identifier.

◆ idT3DTrajectory()

static const std::string& idT3DTrajectory ( )
static

Identifier for rw::trajectory::Trajectory<rw::math::Transform3D> in the XML format.

Returns
the identifier.

◆ idTauAttribute()

static const std::string& idTauAttribute ( )
static

Identifier for the blend time tau used for blends.

Returns
the identifier.

◆ idV3DCircularInterpolator()

static const std::string& idV3DCircularInterpolator ( )
static

Identifier for rw::trajectory::CircularInterpolator<rw::math::Vector3D<> > in the XML format.

Returns
the identifier.

◆ idV3DCubicSplineInterpolator()

static const std::string& idV3DCubicSplineInterpolator ( )
static

Identifier for rw::trajectory::CubicSplineInterpolator<rw::math::Vector3D<> > in the XML format.

Returns
the identifier.

◆ idV3DLinearInterpolator()

static const std::string& idV3DLinearInterpolator ( )
static

Identifier for rw::trajectory::LinearInterpolator<rw::math::Vector3D> in the XML format.

Returns
the identifier.

◆ idV3DTrajectory()

static const std::string& idV3DTrajectory ( )
static

Identifier for rw::trajectory::Trajectory<rw::math::Vector3D> in the XML format.

Returns
the identifier.

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