Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[robot]: use default inertia/mass of zero for links without mass #164

Merged
merged 1 commit into from
Jan 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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