test_opNavPoint
- test_opNavPoint.runReferenceBoresightCheck(sigma_CB, sigma_BN, r_BN_N, alignAxis_C, dropMeasurement=False, sigma_BN_drop=None)[source]
Run
opNavPointand return the boresight-to-target angles of the reference attitude.The reference attitude implied by the output is \([RN] = [BR]^T [BN]\), with \([BR]\) built from
sigma_BR. In that attitude the camera axisalignAxis_Cshould point along the target heading \(-\boldsymbol{r}_{B/N}\).- Parameters:
sigma_CB (list) – camera MRP attitude relative to the body frame
sigma_BN (list) – body MRP attitude relative to the inertial frame
r_BN_N (list) – target-to-spacecraft position vector in inertial components
alignAxis_C (list) – camera axis to point at the target, in camera components
dropMeasurement (bool) – if True, the update after the measurement at 0 s receives an invalid measurement so the stored inertial heading is used instead
sigma_BN_drop (list) – body MRP attitude relative to the inertial frame used for the update after the measurement at 0 s. If None,
sigma_BNis kept. A different attitude makes the stored heading depend on the inertial frame storage, since a heading stored in camera components would no longer point at the target after the rotation.
Each angle is evaluated with the body attitude in effect at the corresponding update.
- Returns:
angle between the reference camera axis and the target heading for each update [rad]
- Return type:
numpy.ndarray
- test_opNavPoint.test_antiparallelHeading(alignAxis_C, sigma_CB)[source]
Verify the 180 degree fallback axis for a target directly behind the camera axis.
The fallback eigen axis is computed in camera components at reset and must be mapped to body components like the regular axis. The
[1, 0, 0]camera axis exercises the secondary cross product used whenalignAxis_Cis parallel to the first camera axis.
- test_opNavPoint.test_defaultTimeOut()[source]
Verify valid images are used when
timeOutis left at its default value of zero.Valid and invalid images alternate, starting with a valid image at 0 s and including consecutive valid and consecutive invalid images. With
timeOut = 0each valid image is used once, on the update where it arrives, and the saved heading is discarded on the next update without a valid image, so it is never reused. Every valid update must therefore produce the tracking error of the image with a zeroomega_RN_B, and every invalid update must produce a zerosigma_BRwith the search rate.
- test_opNavPoint.test_nonZeroCameraMounting(sigma_CB, sigma_BN, dropMeasurement)[source]
Verify the reference attitude points the camera axis at the target for a non-zero
sigma_CB.The principal rotation axis is computed in camera components and must be mapped to body components before it is written to
sigma_BR. The check is performed both with a fresh measurement and with the stored inertial heading after a dropped measurement. In the dropped measurement case the body attitude is rotated tosigma_BN_dropbetween the measurement and the dropped update, so a heading that is not stored in inertial components, or that is not mapped back with the current[CN], would no longer point the camera axis at the target.
- test_opNavPoint.test_retainedMeasurement(timeOut)[source]
Consume each valid message once, retain its inertial heading, and expire it.
Write valid images at 0 s and 4 s, leaving the payload untouched between writes. Rotate the body after the first image and require the reference camera axis to keep pointing at the saved target until timeout. After expiry, search must continue until the second image supplies a new target. With zero timeout, only the updates receiving new images may track. Reset must allow a new measurement at time zero again, and a delayed first read must still expire relative to the message write time.
- test_opNavPoint.test_savedHeadingTimeout(firstMeasurementTime)[source]
Verify the saved heading is reused until
timeOutand a new image is used as soon as it arrives.Valid images are separated by invalid ones. The saved heading must keep producing the tracking error of the last image for less than
timeOutseconds after it, also when the image arrives at 0 s, and the module must switch to the search rate oncetimeOutis reached. A valid image that arrives exactlytimeOutseconds after the previous one must be used on that update instead of being ignored.