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.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | q | Real | [4] | Unit quaternion {w,x,y,z} |
| input | v | Real | [3] | Vector being rotated |
| output | J | Real | [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;