46#if NAVIGATION_SIMULATION_SIMOX_CONTROL
50 const std::string filename =
54 <<
"Robot model " <<
QUOTED(filename) <<
" does not exist.";
58 robot_ = VirtualRobot::RobotIO::loadRobot(filename, VirtualRobot::RobotIO::eStructure);
61 ARMARX_CHECK(robot_->hasConfiguration(params_.configuration))
62 <<
"Robot has no configuration " <<
QUOTED(params_.configuration) <<
".";
66 ARMARX_CHECK(robot_->setToConfiguration(params_.configuration));
68 const VirtualRobot::RobotNodeSetPtr rns = robot_->getRobotNodeSet(params_.nodeSet);
73 model_ = std::make_unique<simox::control::simox::dynamics::VirtualRobotRBDLModel>(rns);
76 <<
"Expected a 3-DoF reduced platform model from node set "
77 <<
QUOTED(params_.nodeSet) <<
" but got " << model_->getnDoF()
78 <<
" DoF. The [x, y, yaw] block extraction below assumes indices 0, 1, 2.";
83 const Eigen::Matrix3d M = massMatrix(Eigen::Vector3d::Zero());
86 <<
QUOTED(params_.configuration) <<
": mass " << M(0, 0)
87 <<
" kg, yaw inertia " << M(2, 2) <<
" kg m^2.\n"
88 <<
"Mass matrix [x, y, yaw] (kg, kg, kg m^2):\n"
99 return model_->getInertiaMatrix(
q);
105 return model_->getInverseDynamics(
q, qdot, Eigen::Vector3d::Zero());
111 return massMatrix(Eigen::Vector3d::Zero())(0, 0);
117 return massMatrix(Eigen::Vector3d::Zero())(2, 2);
124 throw std::runtime_error(
125 "The omni-wheel torque model needs the platform inertia, which requires "
126 "SimoxControl. This build of armarx_navigation was configured without it. Use a "
127 "different `model` in PlatformDynamics.json, or rebuild with SimoxControl available.");
135 return Eigen::Matrix3d::Identity();
141 return Eigen::Vector3d::Zero();