Skip to content

Commit 5563c07

Browse files
committed
Rename PrescribedTrans module messages
The module's PrescribedTransMsgPayload message is replaced with the new LinearTranslationRigidBodyMsgPayload message
1 parent 20f0ccb commit 5563c07

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

src/fswAlgorithms/effectorInterfaces/prescribedTrans/_UnitTest/test_prescribedTrans.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ def prescribedTransTestFunction(show_plots, scalarPosInit, scalarPosRef, scalarA
114114

115115
# Create input message
116116
scalarVelRef = 0.0 # [m/s]
117-
PrescribedTransMessageData = messaging.PrescribedTransMsgPayload()
118-
PrescribedTransMessageData.scalarPos = scalarPosRef
119-
PrescribedTransMessageData.scalarVel = scalarVelRef
120-
PrescribedTransMessage = messaging.PrescribedTransMsg().write(PrescribedTransMessageData)
121-
PrescribedTrans.prescribedTransInMsg.subscribeTo(PrescribedTransMessage)
117+
linearTranslationRigidBodyMessageData = messaging.LinearTranslationRigidBodyMsgPayload()
118+
linearTranslationRigidBodyMessageData.rho = scalarPosRef
119+
linearTranslationRigidBodyMessageData.rhoDot = scalarVelRef
120+
linearTranslationRigidBodyMessage = messaging.LinearTranslationRigidBodyMsg().write(linearTranslationRigidBodyMessageData)
121+
PrescribedTrans.linearTranslationRigidBodyInMsg.subscribeTo(linearTranslationRigidBodyMessage)
122122

123123
# Setup logging on the test module output message so that we get all the writes to it
124124
dataLog = PrescribedTrans.prescribedMotionOutMsg.recorder()

src/fswAlgorithms/effectorInterfaces/prescribedTrans/prescribedTrans.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ void SelfInit_prescribedTrans(PrescribedTransConfig *configData, int64_t moduleI
4949
void Reset_prescribedTrans(PrescribedTransConfig *configData, uint64_t callTime, int64_t moduleID)
5050
{
5151
// Check if the input message is connected
52-
if (!PrescribedTransMsg_C_isLinked(&configData->prescribedTransInMsg)) {
53-
_bskLog(configData->bskLogger, BSK_ERROR, "Error: prescribedTrans.prescribedTransInMsg wasn't connected.");
52+
if (!LinearTranslationRigidBodyMsg_C_isLinked(&configData->linearTranslationRigidBodyInMsg)) {
53+
_bskLog(configData->bskLogger, BSK_ERROR, "Error: prescribedTrans.linearTranslationRigidBodyInMsg wasn't connected.");
5454
}
5555

5656
// Set the initial time
@@ -71,29 +71,29 @@ motion output message.
7171
void Update_prescribedTrans(PrescribedTransConfig *configData, uint64_t callTime, int64_t moduleID)
7272
{
7373
// Create the buffer messages
74-
PrescribedTransMsgPayload prescribedTransIn;
74+
LinearTranslationRigidBodyMsgPayload linearTranslationRigidBodyIn;
7575
PrescribedMotionMsgPayload prescribedMotionOut;
7676

7777
// Zero the output message
7878
prescribedMotionOut = PrescribedMotionMsg_C_zeroMsgPayload();
7979

8080
// Read the input message
81-
prescribedTransIn = PrescribedTransMsg_C_zeroMsgPayload();
82-
if (PrescribedTransMsg_C_isWritten(&configData->prescribedTransInMsg))
81+
linearTranslationRigidBodyIn = LinearTranslationRigidBodyMsg_C_zeroMsgPayload();
82+
if (LinearTranslationRigidBodyMsg_C_isWritten(&configData->linearTranslationRigidBodyInMsg))
8383
{
84-
prescribedTransIn = PrescribedTransMsg_C_read(&configData->prescribedTransInMsg);
84+
linearTranslationRigidBodyIn = LinearTranslationRigidBodyMsg_C_read(&configData->linearTranslationRigidBodyInMsg);
8585
}
8686

8787
// This loop is entered when a new maneuver is requested after all previous maneuvers are completed
88-
if (PrescribedTransMsg_C_timeWritten(&configData->prescribedTransInMsg) <= callTime && configData->convergence)
88+
if (LinearTranslationRigidBodyMsg_C_timeWritten(&configData->linearTranslationRigidBodyInMsg) <= callTime && configData->convergence)
8989
{
9090
// Store the initial information
9191
configData->tInit = callTime * NANO2SEC;
9292
configData->scalarPosInit = v3Norm(configData->r_FM_M);
9393
configData->scalarVelInit = v3Norm(configData->rPrime_FM_M);
9494

9595
// Store the reference information
96-
configData->scalarPosRef = prescribedTransIn.scalarPos;
96+
configData->scalarPosRef = linearTranslationRigidBodyIn.rho;
9797
configData->scalarVelRef = 0.0;
9898

9999
// Define temporal information

src/fswAlgorithms/effectorInterfaces/prescribedTrans/prescribedTrans.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <stdbool.h>
2424
#include "architecture/utilities/bskLogging.h"
2525
#include "cMsgCInterface/PrescribedMotionMsg_C.h"
26-
#include "cMsgCInterface/PrescribedTransMsg_C.h"
26+
#include "cMsgCInterface/LinearTranslationRigidBodyMsg_C.h"
2727

2828
/*! @brief Top level structure for the sub-module routines. */
2929
typedef struct {
@@ -51,10 +51,10 @@ typedef struct {
5151
double b; //!< Parabolic constant for the second half of the maneuver
5252

5353
// Messages
54-
PrescribedTransMsg_C prescribedTransInMsg; //!< Input message for the reference states
55-
PrescribedMotionMsg_C prescribedMotionOutMsg; //!< Output message for the prescribed states
54+
LinearTranslationRigidBodyMsg_C linearTranslationRigidBodyInMsg; //!< Input message for the reference states
55+
PrescribedMotionMsg_C prescribedMotionOutMsg; //!< Output message for the prescribed states
5656

57-
BSKLogger *bskLogger; //!< BSK Logging
57+
BSKLogger *bskLogger; //!< BSK Logging
5858

5959
}PrescribedTransConfig;
6060

src/fswAlgorithms/effectorInterfaces/prescribedTrans/prescribedTrans.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
%include "architecture/msgPayloadDefC/PrescribedMotionMsgPayload.h"
2828
struct PrescribedMotionMsg_C;
2929

30-
%include "architecture/msgPayloadDefC/PrescribedTransMsgPayload.h"
31-
struct PrescribedTransMsg_C;
30+
%include "architecture/msgPayloadDefC/LinearTranslationRigidBodyMsgPayload.h"
31+
struct LinearTranslationRigidBodyMsg_C;
3232

3333
%pythoncode %{
3434
import sys

src/fswAlgorithms/effectorInterfaces/prescribedTrans/prescribedTrans.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ provides information on what this message is used for.
3535
* - Msg Variable Name
3636
- Msg Type
3737
- Description
38-
* - prescribedTransInMsg
39-
- :ref:`PrescribedTransMsgPayload`
38+
* - linearTranslationRigidBodyInMsg
39+
- :ref:`LinearTranslationRigidBodyMsgPayload`
4040
- input msg with the prescribed body reference states
4141
* - prescribedTransOutMsg
4242
- :ref:`PrescribedTransMsgPayload`

0 commit comments

Comments
 (0)