sas
Modularised monitoring, logging, and control of robots.
Loading...
Searching...
No Matches
sas_robot_driver_gazebo::SdfSerialManipulatorLoader Class Reference

Builds a SerialManipulatorSimulatorFriendly from an SDF model. More...

#include <SdfSerialManipulatorLoader.h>

Public Member Functions

SdfManipulatorResult LoadFromFile (const std::string &path, const std::string &model_scope=std::string()) const
 Load a serial manipulator from an SDF model or world file.
SdfManipulatorResult LoadFromSdfFile (const std::string &path) const
 Parse an SDF model file and build the kinematic model.
SdfManipulatorResult LoadFromModel (const sdf::Model *model) const
 Build the kinematic model from an already-loaded SDF model.

Detailed Description

Builds a SerialManipulatorSimulatorFriendly from an SDF model.

The loader expects a strictly serial kinematic chain: a base (the model's canonical) link, then a sequence of joints each connecting the previous link to a new link, every joint acting about the +z axis of its joint frame (so every actuation is RZ for revolute/continuous joints and TZ for prismatic joints). Non-serial topologies, unsupported joint types, or off-axis actuation axes raise std::runtime_error.

Member Function Documentation

◆ LoadFromFile()

SdfManipulatorResult sas_robot_driver_gazebo::SdfSerialManipulatorLoader::LoadFromFile ( const std::string & path,
const std::string & model_scope = std::string() ) const

Load a serial manipulator from an SDF model or world file.

This is the recommended entry point. It transparently handles both Gazebo-SDF files:

  • A <model> file: the model is used directly (equivalent to LoadFromSdfFile).
  • A <world> file (scene): the kinematic model is located within the world, including models nested inside other models through chains (e.g. a robot model wrapped in a position-controller model inside a world). The kinematic model is the one (anywhere in the world's model tree) that has both links and joints; models with only links (static frames, ground planes) or only fixed joints (wrapper models) are skipped.

Relative URIs are resolved against the directory of path, so the file's location is sufficient (no current-directory dependency).

Parameters
pathPath to a Gazebo-SDF model or world file.
model_scopeOptional "::"-separated chain of model names (from a top-level model in the world down to the target) that selects which model to load. Empty: automatic detection (the single model in the tree that has both links and joints). If several candidate models exist, the most deeply nested one is used and result.source_scope reports the selection; pass model_scope to disambiguate explicitly.
Returns
The loaded model plus joint/link names and the source scope that produced it.
Exceptions
std::runtime_errorif the file cannot be parsed, no kinematic model is found, model_scope does not match, the selected model is not a serial manipulator, or a joint does not act about +z.

◆ LoadFromModel()

SdfManipulatorResult sas_robot_driver_gazebo::SdfSerialManipulatorLoader::LoadFromModel ( const sdf::Model * model) const

Build the kinematic model from an already-loaded SDF model.

Parameters
modelPointer to a loaded sdf::Model (must not be null).
Returns
The loaded model and its joint/link names.
Exceptions
std::runtime_erroron structural or actuation violations.

◆ LoadFromSdfFile()

SdfManipulatorResult sas_robot_driver_gazebo::SdfSerialManipulatorLoader::LoadFromSdfFile ( const std::string & path) const

Parse an SDF model file and build the kinematic model.

Parameters
pathPath to a Gazebo-SDF file whose <model> is a serial manipulator.
Returns
The loaded model and its joint/link names.
Exceptions
std::runtime_errorif the file cannot be parsed, is not a serial manipulator, or a joint does not act about the +z axis.

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