![]() |
RobWorkProject
23.9.11-
|
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... | |
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
enum Type |
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
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 | ( | 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
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. |
rw::trajectory::QTrajectory::Ptr getQTrajectory | ( | ) |
Returns trajectory with template type rw::math::Q.
If the loaded path is not of type Transform3DPath it throws an exception.
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.
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.
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.