CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

function

LieGroups.SO3.Quat.rotate_vector_jacobian

Derivative of rotate with respect to the vector being rotated

Rule for rotate, vector slot. Both slot and result are plain vectors, so both are additive and the rule is the rotation matrix itself:

rotate(q, v + dv) - rotate(q, v) = R(q) dv

The identity is exact and independent of v.

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(dv) of (rotate(q, v + dv) - rotate(q, v))

Modelica declarations and implementation

Show parameters, interfaces and source

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

function rotate_vector_jacobian
  "Derivative of rotate with respect to the vector being rotated"
  input Real q[4] "Unit quaternion {w,x,y,z}";
  input Real v[3] "Vector being rotated";
  output Real J[3, 3] "d/d(dv) of (rotate(q, v + dv) - rotate(q, v))";
algorithm
  J := LieGroups.SO3.Quat.to_DCM(q);
  annotation(Documentation(info="<html>
    <p>Rule for <code>rotate</code>, vector slot. Both slot and result are plain
    vectors, so both are additive and the rule is the rotation matrix itself:</p>
    <pre>rotate(q, v + dv) - rotate(q, v) = R(q) dv</pre>
    <p>The identity is exact and independent of v.</p>
  </html>"));
end rotate_vector_jacobian;