Drake
drake::multibody::parsing Namespace Reference

Namespaces

 detail
 

Classes

class  FrameCache
 Keeps a set of frames and the transforms that relate them, using a root or fixed frame to conjoin them all. More...
 
struct  FramedIsometry3
 An isometric transform along with the frame in which it is defined. More...
 
class  SdfJoint
 A representation of a <joint> element in an SDF file. More...
 
class  SdfLink
 A representation of a <link> element in an SDF file. More...
 
class  SdfModel
 This class provides a representation of a <model> element within a given SDF specification. More...
 
class  SdfSpec
 This class provides a representation for an SDF specification. More...
 

Functions

ModelInstanceIndex AddModelFromSdfFile (const std::string &file_name, const std::string &model_name, multibody_plant::MultibodyPlant< double > *plant, geometry::SceneGraph< double > *scene_graph=nullptr)
 Parses a <model> element from the SDF file specified by file_name and adds it to plant. More...
 
ModelInstanceIndex AddModelFromSdfFile (const std::string &file_name, multibody_plant::MultibodyPlant< double > *plant, geometry::SceneGraph< double > *scene_graph=nullptr)
 Alternate version of AddModelFromSdfFile which always uses the "name" element from the model tag for the name of the newly created model instance. More...
 
multibody_plant::CoulombFriction< doubledefault_friction ()
 Default value of the Coulomb's law coefficients of friction for when they are not specified in the SDF file. More...
 
std::unique_ptr< SdfSpecParseSdfModelFromFile (const std::string &sdf_path)
 Parses a single <model> from file a file named sdf_path. More...
 

Function Documentation

ModelInstanceIndex AddModelFromSdfFile ( const std::string &  file_name,
const std::string &  model_name,
multibody_plant::MultibodyPlant< double > *  plant,
geometry::SceneGraph< double > *  scene_graph = nullptr 
)

Parses a <model> element from the SDF file specified by file_name and adds it to plant.

The SDF file can only contain a single <model> element. <world> elements (used for instance to specify gravity) are ignored by this method. A new model instance will be added to plant.

Exceptions
std::runtime_errorif the file is not in accordance with the SDF specification containing a message with a list of errors encountered while parsing the file.
std::runtime_errorif there is more than one <model> element or zero of them.
std::exceptionif plant is nullptr or if MultibodyPlant::Finalize() was already called on plant.
Parameters
file_nameThe name of the SDF file to be parsed.
model_nameThe name given to the newly created instance of this model. If empty, the "name" attribute from the model tag will be used.
plantA pointer to a mutable MultibodyPlant object to which the model will be added.
scene_graphA pointer to a mutable SceneGraph object used for geometry registration (either to model visual or contact geometry). May be nullptr.
Returns
The model instance index for the newly added model.

Here is the call graph for this function:

Here is the caller graph for this function:

ModelInstanceIndex AddModelFromSdfFile ( const std::string &  file_name,
multibody_plant::MultibodyPlant< double > *  plant,
geometry::SceneGraph< double > *  scene_graph = nullptr 
)

Alternate version of AddModelFromSdfFile which always uses the "name" element from the model tag for the name of the newly created model instance.

Here is the call graph for this function:

multibody_plant::CoulombFriction<double> drake::multibody::parsing::default_friction ( )
inline

Default value of the Coulomb's law coefficients of friction for when they are not specified in the SDF file.

Here is the call graph for this function:

Here is the caller graph for this function:

std::unique_ptr< SdfSpec > ParseSdfModelFromFile ( const std::string &  sdf_path)

Parses a single <model> from file a file named sdf_path.

A new SdfSpec object is created which will contain the single model from the file.

Exceptions
std::runtime_errorif there is more than one <model> element in the file.

Here is the call graph for this function: