RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | List of all members
XMLTrajectoryLoader Class Reference

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

#include <XMLTrajectoryLoader.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

 XMLTrajectoryLoader (const std::string &filename, const std::string &schemaFileName="")
 Constructs XMLTrajectoryLoader and parser filename. More...
 
 XMLTrajectoryLoader (std::istream &instream, const std::string &schemaFileName="")
 Constract XMLTrajectoryLoader and parser input from instream. More...
 
virtual ~XMLTrajectoryLoader ()
 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...
 

Detailed Description

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

The XMLTrajectoryLoader 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 XMLTrajectoryLoader::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

◆ XMLTrajectoryLoader() [1/2]

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

Constructs XMLTrajectoryLoader 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.

◆ XMLTrajectoryLoader() [2/2]

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

Constract XMLTrajectoryLoader 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

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