Drake
drake::multibody::parsing::detail Namespace Reference

Functions

std::unique_ptr< geometry::ShapeMakeShapeFromSdfGeometry (const sdf::Geometry &sdf_geometry)
 Given an sdf::Geometry object representing a <geometry> element from an SDF file, this method makes a new drake::geometry::Shape object from this specification. More...
 
std::unique_ptr< GeometryInstance > MakeGeometryInstanceFromSdfVisual (const sdf::Visual &sdf_visual)
 Given an sdf::Visual object representing a <visual> element from an SDF file, this method makes a new drake::geometry::GeometryInstance object from this specification. More...
 
VisualMaterial MakeVisualMaterialFromSdfVisual (const sdf::Visual &sdf_visual)
 Given an sdf::Visual object representing a <visual> element from an SDF file, this method makes a new VisualMaterial object from the specification. More...
 
Isometry3d MakeGeometryPoseFromSdfCollision (const sdf::Collision &sdf_collision)
 Given sdf_collision stemming from the parsing of a <collision> element in an SDF file, this method makes the pose X_LG of frame G for the geometry of that collision element in the frame L of the link it belongs to. More...
 
CoulombFriction< doubleMakeCoulombFrictionFromSdfCollisionOde (const sdf::Collision &sdf_collision)
 Parses friction coefficients from sdf_collision. More...
 
sdf::Visual ResolveVisualUri (const sdf::Visual &original, const parsers::PackageMap &package_map, const std::string &root_dir)
 Given an sdf::Visual object representing a <visual> element from an SDF file, this method makes a new Visual object which resolves the uri for the mesh element, if present. More...
 
Vector3d ToVector3 (const ignition::math::Vector3d &vector)
 Helper function to express an ignition::math::Vector3d instance as a Vector3d instance. More...
 
Isometry3d ToIsometry3 (const ignition::math::Pose3d &pose)
 Helper function to express an ignition::math::Pose3d instance as an Isometry3d instance. More...
 

Function Documentation

multibody_plant::CoulombFriction< double > MakeCoulombFrictionFromSdfCollisionOde ( const sdf::Collision &  sdf_collision)

Parses friction coefficients from sdf_collision.

This method looks for the definitions specific to ODE, as given by the SDF specification in <collision><surface><friction><ode>. Drake understands <mu> as the static coefficient of friction and <mu2> as the dynamic coefficient of friction. Consider the example below:

1 <collision>
2  <surface>
3  <friction>
4  <ode>
5  <mu>0.8</mu>
6  <mu2>0.3</mu2>
7  </ode>
8  </friction>
9  </surface>
10 </collision>

If a <surface> is not found, it returns the coefficients for a frictionless surface. If <surface> is found, all other nested elements are required and an exception is thrown if not present.

Here is the call graph for this function:

Here is the caller graph for this function:

std::unique_ptr< geometry::GeometryInstance > MakeGeometryInstanceFromSdfVisual ( const sdf::Visual &  sdf_visual)

Given an sdf::Visual object representing a <visual> element from an SDF file, this method makes a new drake::geometry::GeometryInstance object from this specification.

This method returns nullptr when the given SDF specification corresponds to a geometry of type sdf::GeometryType::EMPTY (<empty> SDF tag.)

Here is the call graph for this function:

Here is the caller graph for this function:

Eigen::Isometry3d MakeGeometryPoseFromSdfCollision ( const sdf::Collision &  sdf_collision)

Given sdf_collision stemming from the parsing of a <collision> element in an SDF file, this method makes the pose X_LG of frame G for the geometry of that collision element in the frame L of the link it belongs to.

Here is the call graph for this function:

Here is the caller graph for this function:

std::unique_ptr< geometry::Shape > MakeShapeFromSdfGeometry ( const sdf::Geometry &  sdf_geometry)

Given an sdf::Geometry object representing a <geometry> element from an SDF file, this method makes a new drake::geometry::Shape object from this specification.

For sdf_geometry.Type() == sdf::GeometryType::EMPTY, corresponding to the <empty> SDF tag, it returns nullptr.

Here is the call graph for this function:

Here is the caller graph for this function:

geometry::VisualMaterial MakeVisualMaterialFromSdfVisual ( const sdf::Visual &  sdf_visual)

Given an sdf::Visual object representing a <visual> element from an SDF file, this method makes a new VisualMaterial object from the specification.

The visual material comes from the child <material> tag. E.g.,

1 <visual>
2  <geometry>
3  ...
4  </geometry>
5  <material>
6  <ambient>r_a g_a b_a a_a</ambient>
7  <diffuse>r_d g_d b_d a_d</diffuse>
8  <specular>r_s g_s b_s a_s</specular>
9  <emissive>r_e g_e b_e a_e</emissive>
10  </material>
11 </visual>

If there is no material tag, the supported material tags are missing, or there is an error parsing the supported values, the instantiated VisualMaterial will use default values. (See geometry::VisualMaterial for description of the default color.)

Note
Currently, only the diffuse value is included in the VisualMaterial.

Here is the caller graph for this function:

sdf::Visual ResolveVisualUri ( const sdf::Visual &  original,
const parsers::PackageMap package_map,
const std::string &  root_dir 
)

Given an sdf::Visual object representing a <visual> element from an SDF file, this method makes a new Visual object which resolves the uri for the mesh element, if present.

If the mesh element is not present, the new object will be identical to the original. See parsers::ResolveFilename() for more detail on this operation.

Exceptions
std::runtime_errorif the <mesh> tag is present but missing <uri> or if the file referenced in <uri> can not be found.

Here is the call graph for this function:

Here is the caller graph for this function:

Eigen::Isometry3d ToIsometry3 ( const ignition::math::Pose3d &  pose)

Helper function to express an ignition::math::Pose3d instance as an Isometry3d instance.

Here is the call graph for this function:

Here is the caller graph for this function:

Eigen::Vector3d ToVector3 ( const ignition::math::Vector3d &  vector)

Helper function to express an ignition::math::Vector3d instance as a Vector3d instance.

Here is the caller graph for this function: