Module: lambertSecondDV

Executive Summary

This module computes the required Delta-V to change the spacecraft velocity to the desired velocity \({}^N\mathbf{v}_{desired}\) at maneuver time \(t_{maneuver}\). The desired velocity and maneuver time are obtained by the DesiredVelocityMsgPayload input message. The expected velocity \({}^N\mathbf{v}_{expected}\) at maneuver time is obtained from the second velocity in LambertSolutionMsgPayload. That is, this module computes the Delta-V that is required at the end of a Lambert problem transfer arc (at the second position vector of Lambert problem) to obtain some desired velocity. The DvBurnCmdMsgPayload output message is zeroed if the LambertSolutionMsgPayload message indicates that the Lambert solution is not valid.

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

lambertSolutionInMsg

LambertSolutionMsgPayload

lambert problem solution input message

desiredVelocityInMsg

DesiredVelocityMsgPayload

desired inertial velocity input message

dvBurnCmdOutMsg

DvBurnCmdMsgPayload

Delta-V command output message

User Guide

The module is first initialized as follows:

module = lambertSecondDV.LambertSecondDV()
module.ModelTag = "lambertSecondDV"
unitTestSim.AddModelToTask(unitTaskName, module)

The input messages are then connected:

module.lambertSolutionInMsg.subscribeTo(lambertSolutionInMsg)
module.desiredVelocityInMsg.subscribeTo(desiredVelocityInMsg)

class LambertSecondDV : public SysModel
#include <lambertSecondDV.h>

This module computes the second Delta-V maneuver for the Lambert problem.

Public Functions

LambertSecondDV()

This is the constructor for the module class. It sets default variable values and initializes the various parts of the model

~LambertSecondDV()

Module Destructor

void Reset(uint64_t currentSimNanos) override

This method is used to reset the module and checks that required input messages are connected.

Parameters:

currentSimNanos – current simulation time in nano-seconds

Returns:

void

void UpdateState(uint64_t currentSimNanos) override

This is the main method that gets called every time the module is updated.

Parameters:

currentSimNanos – current simulation time in nano-seconds

Returns:

void

void setLambertSolutionSpecifier(const double value)

setter for lambertSolutionSpecifier

inline double getLambertSolutionSpecifier() const

getter for lambertSolutionSpecifier

Public Members

ReadFunctor<LambertSolutionMsgPayload> lambertSolutionInMsg

lambert solution input message

ReadFunctor<DesiredVelocityMsgPayload> desiredVelocityInMsg

desired velocity input message

Message<DvBurnCmdMsgPayload> dvBurnCmdOutMsg

Delta-V burn command message.

BSKLogger bskLogger

BSK Logging.

Private Functions

void readMessages()

This method reads the input messages each call of updateState. It also checks if the message contents are valid for this module.

Returns:

void

void writeMessages(uint64_t currentSimNanos)

This method writes the output messages each call of updateState

Parameters:

currentSimNanos – current simulation time in nano-seconds

Returns:

void

Private Members

double lambertSolutionSpecifier = 1

[-] which Lambert solution (1 or 2), if applicable, should be used

Eigen::Vector3d vExpected_N

[m/s] Expected velocity in inertial frame N components

bool validLambert = false

[-] valid Lambert solution if true

Eigen::Vector3d vDesired_N

[m/s] Desired velocity in inertial frame N

double maneuverTime = {}

[s] time at which maneuver should be executed

Eigen::Vector3d dv_N

[m/s] requested Delta-V in N frame components