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::Transform > | default_free_body_pose |
Map of body_name or frame_name => default free body pose. More... | |
bool IsValid | ( | ) | const |
void Serialize | ( | Archive * | a | ) |
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.
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).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).
std::string file |
The package://
URI of the file to add.
std::string name |
The model instance name.