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").

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
if the transform's base_frame is not the world (explicitly or implicitly by omission), the body associated with the named frame will not be considered a free body (body.is_floating() returns false) and 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).
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: