Skip to content

Commit

Permalink
Merge pull request #164 from resibots/default_inertia
Browse files Browse the repository at this point in the history
[robot]: use default inertia/mass of zero for links without mass
  • Loading branch information
costashatz authored Jan 20, 2022
2 parents 483fbf1 + 19de613 commit bee311e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/robot_dart/robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1927,7 +1927,14 @@ namespace robot_dart {
boost::filesystem::path path(model_file);
std::string extension = path.extension().string();
if (extension == ".urdf") {
#if DART_VERSION_AT_LEAST(6, 12, 0)
dart::io::DartLoader::Options options;
// if links have no inertia, we put ~zero mass and very very small inertia
options.mDefaultInertia = dart::dynamics::Inertia(1e-10, Eigen::Vector3d::Zero(), Eigen::Matrix3d::Identity() * 1e-12);
dart::io::DartLoader loader(options);
#else
dart::io::DartLoader loader;
#endif
for (size_t i = 0; i < packages.size(); i++) {
std::string package = std::get<1>(packages[i]);
std::string package_path = _get_path(package);
Expand Down

0 comments on commit bee311e

Please sign in to comment.