Classes | Public Member Functions | Private Types | Private Member Functions
RobotURDF Class Reference

The RobotURDF class is a Robot class that reads all of the KDL configuration information from a URDF file. More...

#include <RobotURDF.h>

Inheritance diagram for RobotURDF:
Inheritance graph
[legend]

List of all members.

Classes

struct  Joint

Public Member Functions

 RobotURDF (const std::string &filename, const std::string &rootLink)
 Create an instance from the named file.
virtual ~RobotURDF ()
 Release any resources used by this class.

Private Types

typedef std::map< std::string,
Joint
JointMap
typedef std::map< std::string,
KDL::RigidBodyInertia
LinkMap

Private Member Functions

void parseFile (const std::string &filename, const std::string &rootLink)
 Load the specified file into memory and create the KDL tree.
void parseJoint (TiXmlElement *element)
 Use the internal collection of elements to create KDL segments, chains, and a tree.

Detailed Description

The RobotURDF class is a Robot class that reads all of the KDL configuration information from a URDF file.

Definition at line 23 of file RobotURDF.h.


Member Typedef Documentation

typedef std::map<std::string, Joint> RobotURDF::JointMap [private]

Definition at line 39 of file RobotURDF.h.

typedef std::map<std::string, KDL::RigidBodyInertia> RobotURDF::LinkMap [private]

Definition at line 38 of file RobotURDF.h.


Constructor & Destructor Documentation

RobotURDF::RobotURDF ( const std::string &  filename,
const std::string &  rootLink 
)

Create an instance from the named file.

Parameters:
filenamethe name of the URDF file that is to be read
rootLinkthe name of the first link in the file
Exceptions:
runtime_errorif any problems are detected with the file

Definition at line 20 of file RobotURDF.cpp.

RobotURDF::~RobotURDF ( ) [virtual]

Release any resources used by this class.

Definition at line 30 of file RobotURDF.cpp.


Member Function Documentation

void RobotURDF::parseFile ( const std::string &  filename,
const std::string &  rootLink 
) [private]

Load the specified file into memory and create the KDL tree.

The file elements are read into internal collections, then the internal collections are used to build the KDL tree.

Parameters:
filenamethe name of the URDF file that is to be read
rootLinkthe name of the first link in the file
Exceptions:
runtime_errorif any problems are detected with the file

Definition at line 49 of file RobotURDF.cpp.

void RobotURDF::parseJoint ( TiXmlElement *  element) [private]

Use the internal collection of elements to create KDL segments, chains, and a tree.

Warning:
This method currently has limitations associated with branches in the KDL tree. If the first joints after a branch are offset from the joint before the branch the KDL will be wrong. Because this class now lives within a ROS Package, it can and does use the kdl_parser instead of this method.

This method is designed to be called recursively. Each call will add another segment to the current chain. If the current segment has no children the current chain will be added to the tree. If the current segment has exactly one child, this method will be called again for that child. If the current segment has multiple children the current chain will be added to the tree and new chains will be created and populated (by calling this method) for each child segment.

Parameters:
chainthe chain that is currently being built
chainNamethe name of the chain that is being built, when new chains are created by this method, this is set to the name of the first joint in the chain.
chainHookthe name of what this chain should hook into in the tree, when chains are created by this method, this is set to the name of the last segment of the previous chain
jointNamethe name of the joint (baseJoint) that is being processed.
baseJointthe name of the joint that is being processed.
Exceptions:
runtime_errorif any problems are detected while combining the URDF elements into a KDL tree.

Populate the provided map with a list of joints that have the parent with the specified name.

The provided map is cleared before any matching joints are added.

Parameters:
parentNamethe of the parent link

Convert the provided XML element into a KDL::RigidBodyInertia object and store it in the internal link map for later use.

Parameters:
elementa pointer to the XML element that should be parsed

Convert the provided XML element into the internal Joint structure and store the results in the internal joint map

Parameters:
elementa pointer to the XML element that should be parsed.

Definition at line 326 of file RobotURDF.cpp.


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


robodyn_controllers
Author(s):
autogenerated on Sat Jun 8 2019 20:20:54