Aikido
aikido::io Namespace Reference

Namespaces

 detail
 

Classes

class  CatkinResourceRetriever
 Retreive resources specified by 'package://' URIs. More...
 

Functions

dart::dynamics::SkeletonPtr readKinbodyString (const std::string &kinBodyString, const dart::common::Uri &baseUri="", const dart::common::ResourceRetrieverPtr &retriever=nullptr)
 Read skeleton from a string of OpenRAVE's custom XML format. More...
 
dart::dynamics::SkeletonPtr readKinbody (const dart::common::Uri &kinBodyUri, const dart::common::ResourceRetrieverPtr &retriever=nullptr)
 Read skeleton from a file of OpenRAVE's custom XML format. More...
 
void saveTrajectory (const aikido::trajectory::Spline &trajectory, const std::string &savePath)
 Serializes a spline trajectory to YAML. More...
 
aikido::trajectory::UniqueSplinePtr loadSplineTrajectory (const std::string &trajPath, const aikido::statespace::dart::ConstMetaSkeletonStateSpacePtr &metaSkeletonStateSpace)
 Deserializes a spline trajectory from YAML. More...
 
dart::dynamics::SkeletonPtr loadSkeletonFromURDF (const dart::common::ResourceRetrieverPtr &retriever, const dart::common::Uri &uri, const Eigen::Isometry3d &transform=Eigen::Isometry3d::Identity())
 Load a DART Skeleton from a URDF and set its pose. More...
 
YAML::Node loadYAML (const dart::common::Uri &yamlUri, const dart::common::ResourceRetrieverPtr &retriever)
 Retrieves and read all data from a YAML file. More...
 

Function Documentation

◆ loadSkeletonFromURDF()

dart::dynamics::SkeletonPtr aikido::io::loadSkeletonFromURDF ( const dart::common::ResourceRetrieverPtr &  retriever,
const dart::common::Uri &  uri,
const Eigen::Isometry3d &  transform = Eigen::Isometry3d::Identity() 
)

Load a DART Skeleton from a URDF and set its pose.

Parameters
[in]retrieverDART retriever to resolve the URI
[in]uriURI to the object URDF
[in]transformInitial transform for the Skeleton
Returns
the created Skeleton

◆ loadSplineTrajectory()

aikido::trajectory::UniqueSplinePtr aikido::io::loadSplineTrajectory ( const std::string &  trajPath,
const aikido::statespace::dart::ConstMetaSkeletonStateSpacePtr metaSkeletonStateSpace 
)

Deserializes a spline trajectory from YAML.

Parameters
[in]trajPathSpline trajectory
[in]metaSkeletonStateSpaceMetaskeletonStateSpace for the trajectory
Returns
Loaded spline trajectory

◆ loadYAML()

YAML::Node aikido::io::loadYAML ( const dart::common::Uri &  yamlUri,
const dart::common::ResourceRetrieverPtr &  retriever 
)

Retrieves and read all data from a YAML file.

Parameters
[in]yamlUriURI for a YAML file
[in]retrieverResource retriever to retrieve yamlUri
Returns
root YAML::Node of the document

◆ readKinbody()

dart::dynamics::SkeletonPtr aikido::io::readKinbody ( const dart::common::Uri &  kinBodyUri,
const dart::common::ResourceRetrieverPtr &  retriever = nullptr 
)

Read skeleton from a file of OpenRAVE's custom XML format.

This function only parses a subset of the format assuming only one body node in a kinbody file.

The detail of the format can be found at: http://openrave.programmingvision.com/wiki/index.php/Format:XML.

Parameters
[in]kinBodyUriThe URI to a KinBody file. If the URI scheme is not file (i.e., file://), a relevant ResourceRetriever should be passed to retrieve the KinBody file.
[in]retrieverA DART retriever for the URI to a KinBody. The retriever is also used to read the mesh URI in the KinBody file. If nullptr is passed, this function uses a local file resource retriever which only can parse absolute file paths or file URIs (e.g., file://path/to/local/file.kinbody.xml).
Returns
The parsed DART skeleton; returns nullptr on failure.
See also
readKinbodyString

◆ readKinbodyString()

dart::dynamics::SkeletonPtr aikido::io::readKinbodyString ( const std::string &  kinBodyString,
const dart::common::Uri &  baseUri = "",
const dart::common::ResourceRetrieverPtr &  retriever = nullptr 
)

Read skeleton from a string of OpenRAVE's custom XML format.

This function only parses a subset of the format assuming only one body node in a kinbody file.

The following are the available fields that this parser can read.

kinbody - attributes: name
body - attributes: name
geom - attributes: name, type* (none, box, sphere, trimesh, cylinder),
render
data* (or collision) - file* scale [for trimesh] (see below for the
detail)
extents* - 3 float [for box]
height* - float [for cylinder]
radius* - float [for cylinder and sphere]
render - file* scale (see below for the detail)

Elements marked with * are required.

"<render>", "<data>", or "<collision>" contain the relative path to a mesh file and optionally a single float (for all three axes) or three float's (for the x, y, and z-axes) for the scale.

Example forms: "<Render>my/mesh/file.stl<Render>" "<Render>my/mesh/file.stl 0.25<Render> <!--scale for all three axes-->" "<Render>my/mesh/file.stl 0.25 0.5 2.0<Render>"

If the scale is not provided then (1, 1, 1) is used by default.

The detail of the format can be found at: http://openrave.programmingvision.com/wiki/index.php/Format:XML.

Parameters
[in]kinBodyStringThe KinBody XML string.
[in]baseUriThe base URI of the mesh files in the KinBody XML string. If an empty URI, which is the default, is passed, the mesh URIs in the KinBody XML string should be absolute URIs or paths.
[in]retrieverA DART retriever for the mesh URIs in the KinBody XML string. If nullptr is passed, this function uses a local file resource retriever which only can parse absolute file paths or file URIs (e.g., file://path/to/local/file.kinbody.xml).
Returns
The parsed DART skeleton; returns nullptr on failure.
See also
readKinbody

◆ saveTrajectory()

void aikido::io::saveTrajectory ( const aikido::trajectory::Spline trajectory,
const std::string &  savePath 
)

Serializes a spline trajectory to YAML.

Parameters
[in]trajectorySpline trajectory
[in]savePathsave path for the trajectory yaml file