Drake
WorldSimTreeBuilder< T > Class Template Reference

A helper class to construct robot world RigidBodyTree objects from model (URDF/SDF) files. More...

#include <drake/manipulation/util/world_sim_tree_builder.h>

Public Member Functions

 WorldSimTreeBuilder ()
 
 ~WorldSimTreeBuilder ()
 
int AddFixedModelInstance (const std::string &model_name, const Eigen::Vector3d &xyz, const Eigen::Vector3d &rpy=Eigen::Vector3d::Zero())
 Adds a fixed model instance specified by its name, model_name, to the RigidBodyTree being built at the pose specified by position xyz and orientation rpy. More...
 
int AddFloatingModelInstance (const std::string &model_name, const Eigen::Vector3d &xyz, const Eigen::Vector3d &rpy=Eigen::Vector3d::Zero())
 Adds a floating model instance specified by its name, model_name, to the RigidBodyTree being built at the pose specified by position xyz and orientation rpy. More...
 
int AddModelInstanceToFrame (const std::string &model_name, std::shared_ptr< RigidBodyFrame< T >> weld_to_frame, const drake::multibody::joints::FloatingBaseType floating_base_type=drake::multibody::joints::kFixed)
 Adds a model instance specified by its model name, model_name, to the RigidBodyTree being built. More...
 
void AddGround ()
 Adds a flat terrain to the simulation. More...
 
 WorldSimTreeBuilder (const WorldSimTreeBuilder< T > &other)=delete
 
WorldSimTreeBuilderoperator= (const WorldSimTreeBuilder< T > &other)=delete
 
void StoreModel (const std::string &model_name, const std::string &model_path)
 Adds a model to the internal model database. More...
 
std::unique_ptr< RigidBodyTree< T > > Build (void)
 Gets a unique pointer to the RigidBodyTree that was built. More...
 
const RigidBodyTree< T > & tree () const
 Return the (not yet built) tree. More...
 
ModelInstanceInfo< T > get_model_info_for_instance (int id)
 

Detailed Description

template<typename T>
class drake::manipulation::util::WorldSimTreeBuilder< T >

A helper class to construct robot world RigidBodyTree objects from model (URDF/SDF) files.

Models (e.g., robots, objects for manipulation, etc.) can be stored and added to the tree to be built.

Template Parameters
Tmust be a valid Eigen ScalarType.

Instantiated templates for the following ScalarTypes are provided:

  • double

Constructor & Destructor Documentation

WorldSimTreeBuilder ( const WorldSimTreeBuilder< T > &  other)
delete

Member Function Documentation

int AddFixedModelInstance ( const std::string &  model_name,
const Eigen::Vector3d &  xyz,
const Eigen::Vector3d &  rpy = Eigen::Vector3d::Zero() 
)

Adds a fixed model instance specified by its name, model_name, to the RigidBodyTree being built at the pose specified by position xyz and orientation rpy.

The model name must have been previously loaded via a call to StoreModel().

Returns
model_instance_id of the object that is added.
int AddFloatingModelInstance ( const std::string &  model_name,
const Eigen::Vector3d &  xyz,
const Eigen::Vector3d &  rpy = Eigen::Vector3d::Zero() 
)

Adds a floating model instance specified by its name, model_name, to the RigidBodyTree being built at the pose specified by position xyz and orientation rpy.

The model name must have been previously loaded via a call to StoreModel().

Returns
model_instance_id of the object that is added.
void AddGround ( )

Adds a flat terrain to the simulation.

Here is the call graph for this function:

int AddModelInstanceToFrame ( const std::string &  model_name,
std::shared_ptr< RigidBodyFrame< T >>  weld_to_frame,
const drake::multibody::joints::FloatingBaseType  floating_base_type = drake::multibody::joints::kFixed 
)

Adds a model instance specified by its model name, model_name, to the RigidBodyTree being built.

The model instance is connected to the existing world based on a weld_to_frame using a joint of type floating_base_type. The model name must have been previously loaded via a call to StoreModel().

Returns
model_instance_id of the object that is added.

Here is the call graph for this function:

std::unique_ptr<RigidBodyTree<T> > Build ( void  )
inline

Gets a unique pointer to the RigidBodyTree that was built.

This method can only be called if it was not previously called. Ownership of the manufactured RigidBodyTree is transferred to the calling code. The instance of this class should be discarded after this method is called.

ModelInstanceInfo<T> get_model_info_for_instance ( int  id)
inline
WorldSimTreeBuilder& operator= ( const WorldSimTreeBuilder< T > &  other)
delete
void StoreModel ( const std::string &  model_name,
const std::string &  model_path 
)

Adds a model to the internal model database.

Models are described by model_name coupled with URDF/SDF paths in model_path. Instances of these models can then be added to the world via the various AddFoo() methods provided by this class. Note that model_name is user-selectable but must be unique among all of the models that are stored.

See also
AddObjectToFrame
AddFloatingObject
AddFixedObject
const RigidBodyTree<T>& tree ( ) const
inline

Return the (not yet built) tree.

Build() must not have been called yet.


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