Skip to content

Commit

Permalink
Server: explicitly skip auto-inertial calculation (#2166)
Browse files Browse the repository at this point in the history
Automatic inertial calculation may not work in
Root::Load, so explicitly configure the loader
to skip auto-inertial calculation.

Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters authored Sep 28, 2023
1 parent 5ef84a9 commit c5cd260
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ Server::Server(const ServerConfig &_config)
}
gzmsg << msg;
sdf::ParserConfig sdfParserConfig = sdf::ParserConfig::GlobalConfig();
sdfParserConfig.SetCalculateInertialConfiguration(
sdf::ConfigureResolveAutoInertials::SKIP_CALCULATION_IN_LOAD);
errors = this->dataPtr->sdfRoot.LoadSdfString(
_config.SdfString(), sdfParserConfig);
this->dataPtr->sdfRoot.ResolveAutoInertials(errors, sdfParserConfig);
Expand All @@ -143,6 +145,8 @@ Server::Server(const ServerConfig &_config)

sdf::Root sdfRoot;
sdf::ParserConfig sdfParserConfig = sdf::ParserConfig::GlobalConfig();
sdfParserConfig.SetCalculateInertialConfiguration(
sdf::ConfigureResolveAutoInertials::SKIP_CALCULATION_IN_LOAD);

MeshInertiaCalculator meshInertiaCalculator;
sdfParserConfig.RegisterCustomInertiaCalc(meshInertiaCalculator);
Expand Down

0 comments on commit c5cd260

Please sign in to comment.