Is massMatrix in world frame or base frame for floating base rigidBodyTree? (Simscape import, 6-DOF base)

13 次查看(过去 30 天)
Hi everyone,
I’m working with a floating base robot model in MATLAB R2024b, and I’m trying to understand the reference frame in which massMatrix(robot) returns the inertia matrix.
Here’s my setup:
  • I imported a Simscape Multibody model into a rigidBodyTree using importrobot.
  • The robot consists of:
  • A floating base modeled using 3 prismatic + 3 revolute joints to represent a 6-DOF free-floating satellite.
  • A 2-link manipulator arm, with 2 revolute joints mounted on the base.
  • This gives me a total of 8 DOFs.
I’m trying to determine:
Is the mass matrix returned by massMatrix(robot, q) expressed in the world (inertial) frame or in the base (body-fixed) frame for this floating base robot?
I’m trying to confirm:
  1. What frame is massMatrix expressed in when the base is floating?
  2. Should base velocities in q_dot be assumed to be in the world frame or body-fixed frame?
  3. If the base orientation changes, am I supposed to rotate q_dot to stay consistent?
Any guidance or internal documentation references would be much appreciated — especially since I’m trying to match this with symbolic dynamics code I’ve written by hand.
Thanks!

回答(2 个)

Umar
Umar 2025-7-29

Hi @Sathya,

Please bear in mind that I don’t have access to Robotics toolbox because using matlab mobile. So, after doing analysis of your comments, you are working with a floating base robot model in MATLAB's `rigidBodyTree`, particularly one that includes multiple joints such as your configuration with a 6-DOF satellite base and a 2-link manipulator arm, I have to make sure that you do understand that it's crucial to understand how the dynamics functions relate to reference frames. Your specific questions about the `massMatrix(robot, q)` function and its implications for your model can be addressed as follows:

1. Reference Frame of the Mass Matrix

The mass matrix computed by `massMatrix(robot, q)` is expressed in the base (body-fixed) frame of the robot. This is particularly important for floating base models because:

Floating Base Dynamics: The floating base allows for translational and rotational motion in the inertial (world) frame, but the dynamics calculations (including mass matrix) are performed relative to the base's local coordinate system.

Joint Configuration: The input vector `q` should represent joint angles or positions in the context of the robot's configuration at that instant.

2. Base Velocities in `q_dot`

For your configuration vector `q_dot`, which represents joint velocities, you should assume these velocities are expressed in the *body-fixed frame*. This means that:

  • The velocities do not directly correspond to inertial frame velocities unless transformed appropriately.
  • If you need to analyze or simulate behavior in the world frame, you must convert these body-fixed velocities into the world frame using transformation matrices that account for the current orientation of the base.

3. Handling Changes in Base Orientation

When the orientation of your floating base changes, it is essential to apply appropriate transformations to maintain consistency in your calculations. Here’s how to handle this:

Rotation of `q_dot`: If your base orientation changes, you will need to rotate `q_dot` into the world frame. This typically involves using rotation matrices derived from the current orientation (e.g., Euler angles or quaternions).

Transformation Matrix: Use the `getTransform` function from your `rigidBodyTree` object to retrieve the transformation matrix from the base frame to the world frame at any given configuration.

My recommendations

1. Mass Matrix Reference Frame: The mass matrix from `massMatrix(robot, q)` is expressed in the body-fixed frame of the floating base.

2. Joint Velocities (`q_dot`): These should be considered relative to the body-fixed frame unless transformed for world frame analysis.

3. Orientation Changes: When handling changes in orientation: Use transformation matrices to rotate joint velocities (`q_dot`) when needed. Ensure consistent application of frames when conducting dynamics simulations or control applications.

For further details and examples, you can refer to MATLAB’s documentation on rigid body dynamics and transformations:

[Rigid Body Tree Documentation]( https://www.mathworks.com/help/robotics/ref/rigidbodytree.html )

[Dynamics Functions]( https://www.mathworks.com/help/robotics/ref/massmatrix.html )

Utilizing these resources will enhance your understanding and help you align your symbolic dynamics code with MATLAB’s functions effectively.

Hope this helps.


Karsh Tharyani
Karsh Tharyani 2025-8-12,14:08
编辑:Karsh Tharyani 2025-8-12,14:10
Hello @Sathya,
Thanks for your question. The joint i's positions (qi), velocities (qi_dot), and accelerations (qi_ddot) are all expressed in the body i's coordinates.
The following rough equation holds true:
tau=massMatrix*q_ddot+Coriolis Forces+Gravity Torque
Where tau is the combined(concatenated for each joint) joint torque vector, and q_ddot is the combined joint acceleration vector.
I hope that answers your questions.
Karsh

类别

Help CenterFile Exchange 中查找有关 Multibody Dynamics 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by