PlatformInertia.h
Go to the documentation of this file.
1/**
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @author Fabian Reister ( fabian dot reister at kit dot edu )
17 * @date 2026
18 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19 * GNU General Public License
20 */
21
22#pragma once
23
24#include <memory>
25#include <string>
26
27#include <Eigen/Core>
28
29namespace VirtualRobot
30{
31 class Robot;
32 using RobotPtr = std::shared_ptr<Robot>;
33} // namespace VirtualRobot
34
36{
37 class RBDLModel;
38} // namespace simox::control::dynamics
39
41{
42
43 /**
44 * @brief Rigid-body inertia of the mobile platform, from the robot model.
45 *
46 * Wraps a *reduced* simox-control RBDL model built on the three virtual platform joints
47 * (`X_Platform`, `Y_Platform`, `Yaw_Platform` — the `PlatformPlanning` node set). Everything
48 * above the platform is lumped rigidly onto the yaw body at the robot's configuration, so
49 * the result is a 3x3 mass matrix in `[x, y, yaw]`.
50 *
51 * The reduced model is deliberate: ARMAR-7 uses four-bar joints (`Knee`, `Ankle`) and
52 * hemisphere joints (wrists) that RBDL cannot represent as ordinary joints. None of them is
53 * in `PlatformPlanning`, so they are only ever lumped as rigid bodies and never need a
54 * Jacobian.
55 *
56 * @note The robot must be put into its configuration *before* the RBDL model is built —
57 * simox-control freezes the joint transforms at construction time. The constructor
58 * does this in the right order.
59 */
61 {
62 public:
64 {
65 std::string robotPackage{"armar7_models"};
66
67 std::string robotFile{"robotmodel/armar7/Armar7.xml"};
68
69 /// Node set holding exactly the platform DoFs, in [x, y, yaw] order.
70 std::string nodeSet{"PlatformPlanning"};
71
72 /// Robot configuration to lump the upper body at.
73 std::string configuration{"Home"};
74 };
75
76 explicit PlatformInertia(const Parameters& params);
78
81
82 /**
83 * @brief Joint-space mass matrix at platform pose `q`.
84 *
85 * @param q `[x, y, yaw]` with **x and y in metres** and yaw in rad.
86 * @return 3x3, SI: `[kg, kg, kg m^2]` on the diagonal. Depends on yaw only — the two
87 * prismatic DoFs are translation-invariant.
88 */
89 Eigen::Matrix3d massMatrix(const Eigen::Vector3d& q);
90
91 /**
92 * @brief Coriolis, centrifugal and gravity terms at the platform DoFs.
93 *
94 * This is `InverseDynamics(q, qdot, 0)`, i.e. the generalized force needed to hold the
95 * current velocity. It is non-zero because the centre of mass is offset ~150 mm from
96 * the yaw axis. Gravity contributes nothing to purely horizontal DoFs.
97 */
98 Eigen::Vector3d bias(const Eigen::Vector3d& q, const Eigen::Vector3d& qdot);
99
100 /// Total mass of everything lumped onto the platform [kg], i.e. `massMatrix(0)(0, 0)`.
101 double totalMass();
102
103 /// Moment of inertia about the platform's yaw axis [kg m^2], at zero yaw.
104 double yawInertia();
105
106 private:
107 Parameters params_;
108
110
111 std::unique_ptr<simox::control::dynamics::RBDLModel> model_;
112 };
113
114} // namespace armarx::navigation::simulation
PlatformInertia(const PlatformInertia &)=delete
double yawInertia()
Moment of inertia about the platform's yaw axis [kg m^2], at zero yaw.
PlatformInertia & operator=(const PlatformInertia &)=delete
Eigen::Matrix3d massMatrix(const Eigen::Vector3d &q)
Joint-space mass matrix at platform pose q.
double totalMass()
Total mass of everything lumped onto the platform [kg], i.e. massMatrix(0)(0, 0).
Eigen::Vector3d bias(const Eigen::Vector3d &q, const Eigen::Vector3d &qdot)
Coriolis, centrifugal and gravity terms at the platform DoFs.
#define q
This file is part of ArmarX.
Definition FramedPose.h:43
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file is part of ArmarX.
std::string nodeSet
Node set holding exactly the platform DoFs, in [x, y, yaw] order.
std::string configuration
Robot configuration to lump the upper body at.