Module: extForceTorque

Executive Summary

Class used to provide a direct external force and torque on body. This class is used to simulate an external for or torque acting on the body. For example, this module can be used to simulate the external disturbance due to outgasing or a thruster, or be used to directly apply requested control forces or torques.

The module 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

cmdTorqueInMsg

CmdTorqueBodyMsgPayload

commanded torque input msg

cmdForceBodyInMsg

CmdForceBodyMsgPayload

commanded force input msg in B frame

cmdForceInertialInMsg

CmdForceInertialMsgPayload

commanded force input msg in N frame


class ExtForceTorque : public SysModel, public DynamicEffector
#include <extForceTorque.h>

external force and torque dynamic efector class

Public Functions

ExtForceTorque()

This is the constructor. It sets some default initializers that can be overriden by the user.

~ExtForceTorque()

The destructor. Nothing of note is performed here

void Reset(uint64_t CurrentSimNanos)

This method is used to reset the module.

Returns:

void

void UpdateState(uint64_t CurrentSimNanos)

class method

void linkInStates(DynParamManager &statesIn)

class method

void writeOutputMessages(uint64_t currentClock)

class method

This module does not write any output messages.

Parameters:

currentClock – The current time used for time-stamping the message

Returns:

void

void readInputMessages()

This method is used to read the incoming message and set the associated buffer structure.

Returns:

void

void computeForceTorque(double integTime, double timeStep)

This method is used to compute the RHS forces and torques. Note: the module can set any of these three vecors, or a subset. Regarding the external force, the matrix representations in the body (B) and inerial (N) frame components are treated as 2 separate vectors. Only set both if you mean to, as both vectors will be included.

Public Members

Eigen::Vector3d extForce_N

[N] external force in inertial frame components

Eigen::Vector3d extForce_B

[N] external force in body frame components

Eigen::Vector3d extTorquePntB_B

[Nm] external torque in body frame components

BSKLogger bskLogger

&#8212; BSK Logging

ReadFunctor<CmdTorqueBodyMsgPayload> cmdTorqueInMsg

commanded torque input msg

ReadFunctor<CmdForceBodyMsgPayload> cmdForceBodyInMsg

commanded force input msg in B frame

ReadFunctor<CmdForceInertialMsgPayload> cmdForceInertialInMsg

commanded force input msg in N frame

Private Members

CmdTorqueBodyMsgPayload incomingCmdTorqueBuffer

&#8212; One-time allocation for savings

CmdForceInertialMsgPayload incomingCmdForceInertialBuffer

&#8212; One-time allocation for savings

CmdForceBodyMsgPayload incomingCmdForceBodyBuffer

&#8212; One-time allocation for savings