CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

package

Tests.RuleChecks

Central-difference oracles and residual drivers for the LieGroups derivative rules

Each fd* function is a central difference of one LieGroups primitive taken in exactly the trivialization that primitive's rule declares: a group-valued slot is perturbed as X*exp_map(h e), a group-valued result is read back as log_map(Y^-1 Y_perturbed), and plain vectors are perturbed and read back additively. The *Residuals drivers sweep randomized points at a chosen magnitude and return the worst absolute disagreement between rule and difference, one entry per rule.

The step is a caller argument because the two error sources move in opposite directions: the central difference truncates at O(h^2) times a third derivative and rounds at O(eps/h) times the value, so the floor sits near h = 1e-6 for double-precision quantities of order one.

Members

NameKindDescription
pseudoRandomfunctionDeterministic pseudo-random stream on [-1, 1]
fdSo3ExpMapJacobianfunctionCentral difference of SO(3) exp_map, right-trivialized output
fdSo3LogMapJacobianfunctionCentral difference of SO(3) log_map, right-trivialized input
fdSo3ProductJacobianfunctionCentral difference of the SO(3) product in one of its two slots
fdSo3InverseJacobianfunctionCentral difference of SO(3) inverse, right-trivialized on both sides
fdSo3RotateJacobianfunctionCentral difference of SO(3) rotate in one of its two slots
fdSe23ProductJacobianfunctionCentral difference of the SE_2(3) product in one of its two slots
fdSe23InverseJacobianfunctionCentral difference of SE_2(3) inverse, right-trivialized on both sides
fdExpMixedJacobianfunctionCentral difference of exp_mixed in one of its three differentiated slots
retrodictTangentErrorfunctionDelayed-tangent error retrodict produces for one perturbation of the current state
fdRetrodictJacobianfunctionCentral difference of retrodict in the ESKF tangent, right-trivialized pose
retrodictChainfunctionTangent map of retrodict built by chaining LieGroups derivative rules
so3RuleResidualsfunctionWorst |rule - central difference| over randomized SO(3) points
so3RuleResidualsSweepfunctionWorst |rule - central difference| over a whole list of rotation magnitudes
so3JacobianFamilyResidualsfunctionHow far the rule-local SO(3) Jacobian family is from its own identities
se23GroupRuleResidualsfunctionWorst |rule - central difference| for the SE_2(3) group rules
expMixedRuleResidualsfunctionWorst |rule - central difference| for the exp_mixed rules
expMixedRuleResidualsSweepfunctionWorst |rule - central difference| for the exp_mixed rules over a magnitude list
retrodictChainResidualsfunctionChained rules against the retrodict difference and against the transition construction

Modelica declarations and implementation

Show parameters, interfaces and source

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

package RuleChecks
  "Central-difference oracles and residual drivers for the LieGroups derivative rules"
  annotation(Documentation(info="<html>
    <p>Each <code>fd*</code> function is a central difference of one LieGroups
    primitive taken in exactly the trivialization that primitive's rule
    declares: a group-valued slot is perturbed as
    <code>X*exp_map(h e)</code>, a group-valued result is read back as
    <code>log_map(Y^-1 Y_perturbed)</code>, and plain vectors are perturbed and
    read back additively. The <code>*Residuals</code> drivers sweep randomized
    points at a chosen magnitude and return the worst absolute disagreement
    between rule and difference, one entry per rule.</p>
    <p>The step is a caller argument because the two error sources move in
    opposite directions: the central difference truncates at O(h^2) times a
    third derivative and rounds at O(eps/h) times the value, so the floor sits
    near h = 1e-6 for double-precision quantities of order one.</p>
  </html>"));
end RuleChecks;