CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

function

LieGroups.SO3.Quat.rotate_rotation_jacobian

Right-trivialized derivative of rotate with respect to its quaternion

Rule for rotate, rotation slot. The quaternion is perturbed on the right; the result is a plain vector and is read back additively:

rotate(q*exp_map(dq), v) - rotate(q, v) = -R(q) [v]x dq + O(|dq|^2)

Public declarations

Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.

RoleNameTypeDimensions / attributes / defaultDescription
inputqReal[4]Unit quaternion {w,x,y,z}
inputvReal[3]Vector being rotated
outputJReal[3, 3]d/d(dq) of (rotate(q*exp_map(dq), v) - rotate(q, v))

Modelica declarations and implementation

Show parameters, interfaces and source

Parameters, inputs, outputs, defaults and equations from the source file.

function rotate_rotation_jacobian
  "Right-trivialized derivative of rotate with respect to its quaternion"
  input Real q[4] "Unit quaternion {w,x,y,z}";
  input Real v[3] "Vector being rotated";
  output Real J[3, 3] "d/d(dq) of (rotate(q*exp_map(dq), v) - rotate(q, v))";
algorithm
  J := -LieGroups.SO3.Quat.to_DCM(q) * LieGroups.SO3.Quat.wedge(v);
  annotation(Documentation(info="<html>
    <p>Rule for <code>rotate</code>, rotation slot. The quaternion is perturbed
    on the right; the result is a plain vector and is read back additively:</p>
    <pre>rotate(q*exp_map(dq), v) - rotate(q, v) = -R(q) [v]x dq + O(|dq|^2)</pre>
  </html>"));
end rotate_rotation_jacobian;