Skip to content

Commit

Permalink
Corrected default density value
Browse files Browse the repository at this point in the history
Signed-off-by: Jasmeet Singh <jasmeet0915@gmail.com>
  • Loading branch information
jasmeet0915 committed Jul 17, 2023
1 parent 42a4707 commit bbacbe9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sdf/1.11/collision.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<description>Maximum number of contacts allowed between two entities. This value overrides the max_contacts element defined in physics.</description>
</element>

<element name="material_density" type="double" default="1.0" required="0">
<description>Density of the collision geometry. Default is the density of water 1.0 kg/m^3</description>
<element name="material_density" type="double" default="1000.0" required="0">
<description>Density of the collision geometry. Default is the density of water 1000 kg/m^3</description>
</element>

<include filename="pose.sdf" required="0"/>
Expand Down
6 changes: 3 additions & 3 deletions src/Collision.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class sdf::Collision::Implementation
/// \brief The collision's surface parameters.
public: sdf::Surface surface;

/// \brief Density of the collision. Default is 1.0
/// \brief Density of the collision. Default is 1000.0
public: double density;

/// \brief The SDF element pointer used during load.
Expand Down Expand Up @@ -118,10 +118,10 @@ Errors Collision::Load(ElementPtr _sdf, const ParserConfig &_config)
}
else
{
this->dataPtr->density = 1.0;
this->dataPtr->density = 1000.0;
errors.push_back({ErrorCode::ELEMENT_MISSING,
"Collision is missing a <material_density> child "
"element. Using a density of 1.0"});
"element. Using a density of 1000.0"});
}

// Load the surface parameters if they are given
Expand Down

0 comments on commit bbacbe9

Please sign in to comment.