NPS-SRL / SPART

Open-source modeling and control toolkit for mobile-base robotic multibody systems
Other
42 stars 17 forks source link

Inconsistent base rotation representation in Simulink Plant model #6

Open nickfaraco opened 7 months ago

nickfaraco commented 7 months ago

I'm under the impression that there's a mismatch in the attitude representation of the base (quaternion q0) in the Plant model of the simulink library. The kinematic equation of the quaterion derivative in the State_Intergrator block assumes the q0 quaternion to be the one associated with the rotation matrix that tranforms vectors expressed in the inertial frame into the same vector expressed in the base spacecraft frame. This is in accordance with the fact that, inside the Matrices block, the DCM associated with q0 is transposed before being fed to the Kinematics function, as it requires the matrix to be the one that expresses body-frame vectors in the inertial frame.

The TEE pose retrieved from the Kinematics&Dynamics block therefore expresses the rotation from the end-effector frame to the inertial one (the columns of the matrix are the components of the end-effector frame axes in the inertial frame), as one would expect. In the EndEffector block, however, the DCM extracted from TEE is transposed again before retrieving the quaternion qEE, causing the aforementioned mismatch. The xEE state therefore contains the conjugate of the quaternion it should.

This could be solved in two ways:

Some tests and verifications have shown results in accordance with my hypotesis. If you think I'm wrong, please let me know.