how get coriolis matrix and inertia matrix for rididBodyTree

I know for serialLink there are functions M = robot. inertia(q) and C = robot. coriolis(q,qd) .Well, I didn't find any function for rigidBodyTree.

Answers (2)

Hello 舒媛 ,
The inertia matrix (M(q)) is a key component in the dynamics equation.
To calculate the inertia matrix, use the massMatrix object function with your current robot configuration.
Unfortunately, there isn’t a direct function for obtaining the Coriolis matrix or inertia matrix for a rigidBodyTree. However, you can compute the Coriolis terms and inertia matrix manually using the following equation -
Here,
  • M(q) — is a joint-space mass matrix based on the current robot configuration. You can calculate this matrix by using the "massMatrix" object function.
  • C(q,˙q) — are the Coriolis terms, which are multiplied by ˙q to calculate the velocity product. You can calculate the velocity product by using by the "velocityProduct" object function.
  • G(q) — is the gravity torques and forces required for all joints to maintain their positions in the specified gravity "Gravity". You can calculate the gravity torque by using the "gravityTorque" object function.
  • J(q) — is the geometric Jacobian for the specified joint configuration. You can calculate the geometric Jacobian by using the "geometricJacobian" object function.
  • FExt — is a matrix of the external forces applied to the rigid body. You can generate external forces by using the "externalForce" object function.
  • τ — are the joint torques and forces applied directly as a vector to each joint.
  • q,˙q,¨q — are the joint configuration, joint velocities, and joint accelerations, respectively, as individual vectors. For revolute joints, kindly specify values in radians, rad/s, and rad/s2, respectively. For prismatic joints, specify in meters, m/s, and m/s2.
I hope this helps.
As mentioned by Sachin, you can compute the inertia matrix with the massMatrix function on the rigidBodyTree. "Joint-space inertia matrix" and "mass matrix" are synonymous.
Although there is no direct way of computing the Coriolis matrix on a rigidBodyTree, there is an implementation available in coriolisMatrix, which you can use as a reference. This function takes a rigidBodyTree, joint configuration q, and joint velocity qd as inputs.
You can see the usage of these functions in sections 9.2.2 and 9.2.3 of Robotics, Vision, and Control (3rd edition).

Asked:

on 16 May 2024

Answered:

on 2 Dec 2025

Community Treasure Hunt

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

Start Hunting!