Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
rdf_loader::RDFLoader Class Reference

#include <rdf_loader.h>

Public Member Functions

const std::string & getRobotDescription () const
 Get the resolved parameter name for the robot description. More...
 
const srdf::ModelSharedPtrgetSRDF () const
 Get the parsed SRDF model. More...
 
const urdf::ModelInterfaceSharedPtr & getURDF () const
 Get the parsed URDF model. More...
 
 RDFLoader (const std::string &robot_description="robot_description")
 Default constructor. More...
 
 RDFLoader (const std::string &urdf_string, const std::string &srdf_string)
 Initialize the robot model from a string representation of the URDF and SRDF documents. More...
 

Static Public Member Functions

static bool isXacroFile (const std::string &path)
 determine if given path points to a xacro file More...
 
static bool loadFileToString (std::string &buffer, const std::string &path)
 load file from given path into buffer More...
 
static bool loadPkgFileToString (std::string &buffer, const std::string &package_name, const std::string &relative_path, const std::vector< std::string > &xacro_args)
 helper that generates a file path based on package name and relative file path to package More...
 
static bool loadXacroFileToString (std::string &buffer, const std::string &path, const std::vector< std::string > &xacro_args)
 run xacro with the given args on the file, return result in buffer More...
 
static bool loadXmlFileToString (std::string &buffer, const std::string &path, const std::vector< std::string > &xacro_args)
 helper that branches between loadFileToString() and loadXacroFileToString() based on result of isXacroFile() More...
 

Private Attributes

std::string robot_description_
 
srdf::ModelSharedPtr srdf_
 
urdf::ModelInterfaceSharedPtr urdf_
 

Detailed Description

Loader for .urdf and .srdf descriptions

Definition at line 80 of file rdf_loader.h.

Constructor & Destructor Documentation

◆ RDFLoader() [1/2]

rdf_loader::RDFLoader::RDFLoader ( const std::string &  robot_description = "robot_description")

Default constructor.

Parameters
robot_descriptionThe string name corresponding to the ROS param where the URDF is loaded; the SRDF is assumed to be at the same param name + the "_semantic" suffix

Definition at line 58 of file rdf_loader.cpp.

◆ RDFLoader() [2/2]

rdf_loader::RDFLoader::RDFLoader ( const std::string &  urdf_string,
const std::string &  srdf_string 
)

Initialize the robot model from a string representation of the URDF and SRDF documents.

Definition at line 101 of file rdf_loader.cpp.

Member Function Documentation

◆ getRobotDescription()

const std::string& rdf_loader::RDFLoader::getRobotDescription ( ) const
inline

Get the resolved parameter name for the robot description.

Definition at line 92 of file rdf_loader.h.

◆ getSRDF()

const srdf::ModelSharedPtr& rdf_loader::RDFLoader::getSRDF ( ) const
inline

Get the parsed SRDF model.

Definition at line 104 of file rdf_loader.h.

◆ getURDF()

const urdf::ModelInterfaceSharedPtr& rdf_loader::RDFLoader::getURDF ( ) const
inline

Get the parsed URDF model.

Definition at line 98 of file rdf_loader.h.

◆ isXacroFile()

bool rdf_loader::RDFLoader::isXacroFile ( const std::string &  path)
static

determine if given path points to a xacro file

Definition at line 123 of file rdf_loader.cpp.

◆ loadFileToString()

bool rdf_loader::RDFLoader::loadFileToString ( std::string &  buffer,
const std::string &  path 
)
static

load file from given path into buffer

Definition at line 131 of file rdf_loader.cpp.

◆ loadPkgFileToString()

bool rdf_loader::RDFLoader::loadPkgFileToString ( std::string &  buffer,
const std::string &  package_name,
const std::string &  relative_path,
const std::vector< std::string > &  xacro_args 
)
static

helper that generates a file path based on package name and relative file path to package

Definition at line 212 of file rdf_loader.cpp.

◆ loadXacroFileToString()

bool rdf_loader::RDFLoader::loadXacroFileToString ( std::string &  buffer,
const std::string &  path,
const std::vector< std::string > &  xacro_args 
)
static

run xacro with the given args on the file, return result in buffer

Definition at line 162 of file rdf_loader.cpp.

◆ loadXmlFileToString()

bool rdf_loader::RDFLoader::loadXmlFileToString ( std::string &  buffer,
const std::string &  path,
const std::vector< std::string > &  xacro_args 
)
static

helper that branches between loadFileToString() and loadXacroFileToString() based on result of isXacroFile()

Definition at line 201 of file rdf_loader.cpp.

Member Data Documentation

◆ robot_description_

std::string rdf_loader::RDFLoader::robot_description_
private

Definition at line 129 of file rdf_loader.h.

◆ srdf_

srdf::ModelSharedPtr rdf_loader::RDFLoader::srdf_
private

Definition at line 130 of file rdf_loader.h.

◆ urdf_

urdf::ModelInterfaceSharedPtr rdf_loader::RDFLoader::urdf_
private

Definition at line 131 of file rdf_loader.h.


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


planning
Author(s): Ioan Sucan , Sachin Chitta
autogenerated on Thu Nov 21 2024 03:24:18