lambertSurfaceRelativeVelocity#

Executive Summary#

This module computes the required inertial spacecraft velocity \({}^N\mathbf{v}_{B/N}\) to satisfy the desired relative velocity to the surface \({}^S\mathbf{v}_{rel,des}\) at position \({}^N\mathbf{r}_{B/N}\) and (maneuver) time \(t\). The module takes into account the rotation and orientation of the celestial body, provided by the EphemerisMsgPayload. The spacecraft position \({}^N\mathbf{r}_{B/N}\) is provided by the second position vector \({}^N\mathbf{r}_{2} in `:ref:`LambertProblemMsgPayload\), as this module is designed to be used at the end of a Lambert problem transfer arc. The surface frame S, in which the desired relative velocity vector is expressed in, is an East-North-Up frame (third unit vector is in the radial direction, first unit vector is perpendicular to the angular velocity vector of the celestial body and the radial direction, and the second unit vector completes the right-handed coordinate frame). The computed required inertial spacecraft velocity and maneuver time are written to the DesiredVelocityMsgPayload output message.

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

lambertProblemInMsg

lambertProblemMsgPayload

lambert problem setup input message

ephemerisInMsg

EphemerisMsgPayload

ephemeris input message

desiredVelocityOutMsg

DesiredVelocityMsgPayload

Desired velocity output message

Algorithm#

The required inertial spacecraft velocity is computed by:

(1)#\[\mathbf{v}_{B/N} = \mathbf{\omega}_{P/N} \times \mathbf{r}_{B/N} + \mathbf{v}_{rel,des}\]

where \(\mathbf{\omega}_{P/N}\) is the angular velocity of the planet fixed frame P w.r.t. the inertial frame N.

User Guide#

The module is first initialized as follows:

module = lambertSurfaceRelativeVelocity.LambertSurfaceRelativeVelocity()
module.modelTag = "lambertSurfaceRelativeVelocity"
module.vRelativeDesired_S = np.array([0., 0., 10.])  # in surface frame (East-North-Up)
module.time = 1000.
unitTestSim.AddModelToTask(unitTaskName, module)

The input messages are then connected:

module.lambertProblemInMsg.subscribeTo(lambertProblemInMsg)
module.ephemerisInMsg.subscribeTo(ephemerisInMsg)

Class LambertSurfaceRelativeVelocity#

class LambertSurfaceRelativeVelocity : public SysModel#

This module computes the inertial velocity corresponding to a given position and relative velocity to the celestial body surface.

Public Functions

LambertSurfaceRelativeVelocity()#

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

~LambertSurfaceRelativeVelocity()#

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. It computes the solution of Lambert’s problem.

Parameters:

currentSimNanos – current simulation time in nano-seconds

Returns:

void

Public Members

ReadFunctor<LambertProblemMsgPayload> lambertProblemInMsg#

lambert problem input message

ReadFunctor<EphemerisMsgPayload> ephemerisInMsg#

ephemeris input message

Message<DesiredVelocityMsgPayload> desiredVelocityOutMsg#

desired inertial velocity output message

BSKLogger bskLogger#

&#8212; BSK Logging

Eigen::Vector3d vRelativeDesired_S#

[m/s] desired relative velocity, in surface frame S (East-North-Up)

double time = {}#

[s] time for the desired velocity of the spacecraft