Module: opNavPoint

Executive Summary

This module implements a opNav point attitude guidance routine.

This algorithm is intended to be incredibly simple and robust: it finds the angle error between the camera boresight (or desired control axis in the camera frame) and the planet heading in the camera frame and brings them to zero. This is analoguous to sunSafePoint. The file PDF Description. contains further information on this module’s function, how to run it, as well as testing.

Message Connection Descriptions

The following table lists all the module input and output messages. The module msg connection is set by the user from python. The msg type contains a link to the message structure definition, while the description provides information on what this message is used for.

Module I/O Messages

Msg Variable Name

Msg Type

Description

attGuidanceOutMsg

AttGuidMsgPayload

name of the output guidance message

opnavDataInMsg

OpNavMsgPayload

name of the optical navigation input message

imuInMsg

NavAttMsgPayload

name of the incoming IMU message

cameraConfigInMsg

CameraConfigMsgPayload

name of the camera config message


Functions

void SelfInit_opNavPoint(OpNavPointConfig *configData, int64_t moduleID)

This method initializes the configData for the opNav attitude guidance. It checks to ensure that the inputs are sane and then creates the output message

Parameters
  • configData – The configuration data associated with the opNav guidance

  • moduleID – The Basilisk module identifier

Returns

void

void Update_opNavPoint(OpNavPointConfig *configData, uint64_t callTime, int64_t moduleID)

This method takes the estimated camera-observed target vector and computes the current attitude/attitude rate errors to pass on to control.

Parameters
  • configData – The configuration data associated with the opNav attitude guidance

  • callTime – The clock time at which the function was called (nanoseconds)

  • moduleID – The Basilisk module identifier

Returns

void

void Reset_opNavPoint(OpNavPointConfig *configData, uint64_t callTime, int64_t moduleID)

This method performs a complete reset of the module. Local module variables that retain time varying states between function calls are reset to their default values.

Parameters
  • configData – The configuration data associated with the guidance module

  • callTime – The clock time at which the function was called (nanoseconds)

  • moduleID – The Basilisk module identifier

Returns

void

struct OpNavPointConfig
#include <opNavPoint.h>

module configuration message definition

Public Members

AttGuidMsg_C attGuidanceOutMsg

The name of the output message

OpNavMsg_C opnavDataInMsg

The name of the Input message

NavAttMsg_C imuInMsg

The name of the incoming IMU message

CameraConfigMsg_C cameraConfigInMsg

The name of the camera config message.

double minUnitMag

&#8212; The minimally acceptable norm of opNav body vector

double opNavAngleErr

&#8212; rad The current error between cmd and obs opNav angle

double smallAngle

&#8212; rad An angle value that specifies what is near 0 or 180 degrees

double eHat180_B[3]

&#8212; Eigen axis to use if commanded axis is 180 from opNav axis

double opNavMnvrVec[3]

&#8212; The eigen axis that we want to rotate on to see target

double lastTime

&#8212; Last time a measurement came in to integrate pointing

double timeOut

&#8212; If no images were seen in this much time, stop using past values

double alignAxis_C[3]

&#8212; Desired camera vector to point at target

double currentHeading_N[3]

&#8212; Previous heading command in intertial Frame

double omega_RN_B[3]

&#8212; Desired body rate vector if no opNav direction is available

double opNavAxisSpinRate

&#8212; r/s Desired constant spin rate about opNav vector

AttGuidMsgPayload attGuidanceOutBuffer

&#8212; The output data that we compute

BSKLogger *bskLogger

BSK Logging.