Class MobileModel
Defined in File mobile_model.h
Class Documentation
-
class MobileModel
Calculates poses for mobile robot frames using Pinocchio.
This class provides forward kinematics for mobile robots. It is constructed from a mobile robot URDF and will reject arm robot URDFs.
Note
The pose() method is RT-safe (zero heap allocation). Passive joints (casters, rocker arm) are held at their neutral configuration internally.
Public Functions
-
explicit MobileModel(const std::string &urdf_model)
Constructs a MobileModel from a URDF string.
- Parameters:
urdf_model – [in] The URDF model string describing a mobile robot.
- Throws:
ModelException – if the URDF describes an arm robot rather than a mobile robot.
-
MobileModel(MobileModel &&other) noexcept
Move-constructs a new MobileModel instance.
- Parameters:
other – [in] Other MobileModel instance.
-
MobileModel &operator=(MobileModel &&other) noexcept
Move-assigns this MobileModel from another MobileModel instance.
- Parameters:
other – [in] Other MobileModel instance.
- Returns:
MobileModel instance.
-
~MobileModel() noexcept
Destructor.
-
std::array<double, 16> pose(MobileFrame frame, const MobileJointPositions &joint_positions) const
Gets the 4x4 pose matrix for the given mobile frame relative to the robot’s base frame (URDF root link, body-fixed).
The pose is represented as a 4x4 matrix in column-major format. This method is RT-safe: it performs zero heap allocation.
- Parameters:
frame – [in] The desired drive module frame (kFrontDriveModule or kRearDriveModule).
joint_positions – [in] Joint positions for all controllable subsystems. Angles are in radians; the conversion to the internal Pinocchio representation is handled automatically.
- Returns:
Vectorized 4x4 pose matrix, column-major.
Public Static Attributes
-
static constexpr size_t kNumModules = kNumDriveModules
Number of swerve drive modules.
-
static constexpr size_t kJointsPerModule = kJointsPerDriveModule
Number of joints per drive module (steering + drive).
-
explicit MobileModel(const std::string &urdf_model)