Drake
Drake C++ Documentation
AddModel Struct Reference

Detailed Description

Directive to add a model from a URDF or SDFormat file to a scene, using a given name for the added instance.

#include <drake/multibody/parsing/model_directives.h>

Public Member Functions

bool IsValid () const
 
template<typename Archive >
void Serialize (Archive *a)
 

Public Attributes

std::string file
 The package:// URI of the file to add. More...
 
std::string name
 The model instance name. More...
 
std::map< std::string, Eigen::VectorXd > default_joint_positions
 Map of joint_name => default position vector. More...
 
std::map< std::string, drake::schema::Transformdefault_free_body_pose
 Map of body_name or frame_name => default free body pose. More...
 

Member Function Documentation

◆ IsValid()

bool IsValid ( ) const

◆ Serialize()

void Serialize ( Archive *  a)

Member Data Documentation

◆ default_free_body_pose

std::map<std::string, drake::schema::Transform> default_free_body_pose

Map of body_name or frame_name => default free body pose.

The name must be a name within the scope of the model added by this directive. The name must not be scoped (i.e., no "foo::link", just "link"). If the name is empty, then the posed frame will be the body frame of the model's sole body (and if the model has >1 body then it is an error).

However, the schema::Transform associated with that named body/frame can define a base_frame referring to any frame that has been added prior to or including this declaration. The named frame must always be a scoped name, even if its part of the model added by this directive.

Warning
there are two important implications for the named frame if the transform's base_frame is not the world (explicitly or implicitly by omission):
  1. The named body will not be considered a "floating base" body (see Working with free bodies). Calls to MultibodyPlant::SetDefaultFreeBodyPose() will have no effect on an allocated context. If you want to change its default pose after adding the model, you need to acquire the body's joint and set the new default pose on the joint directly. Note: what you will actually be posing is the named frame. If it's the name of the body, you will be posing the body. If it's a frame affixed to the body frame, you will be posing the fixed frame (with the body offset based on the relationship between the two frames).
  2. The body associated with the named frame will have a six-dof joint between itself and the body associated with the transform's base_frame. When interpreting the qs for the "named" body, it is the six-dof pose of the body measured and expressed in the parent frame (transform's base_frame). This is true whether setting the position values in the resulting joint directly or using the MultibodyPlant free body APIs.
Warning
There should not already be a joint in the model between the two bodies implied by the named frames.

◆ default_joint_positions

std::map<std::string, Eigen::VectorXd> default_joint_positions

Map of joint_name => default position vector.

Each joint name must be a name within the scope of the model added by this directive. The name must not contains this model's scoped name (nor that of any previously added model).

◆ file

std::string file

The package:// URI of the file to add.

◆ name

std::string name

The model instance name.


The documentation for this struct was generated from the following file: