Skip to content

Feature/817 mechanism for zeroing effector control alg msg outputs#943

Merged
Natsoulas merged 4 commits into
developfrom
feature/817-mechanism-for-zeroing-effector-control-alg-msg-outputs
Apr 4, 2025
Merged

Feature/817 mechanism for zeroing effector control alg msg outputs#943
Natsoulas merged 4 commits into
developfrom
feature/817-mechanism-for-zeroing-effector-control-alg-msg-outputs

Conversation

@Natsoulas
Copy link
Copy Markdown
Contributor

@Natsoulas Natsoulas commented Feb 27, 2025

Description

This PR addresses the issue of FSW algorithm modules failing to zero their output messages when disabled, which could lead to runaway operations. The approach taken was to review effector interface modules and implement consistent zeroing functionality in their reset methods.

The following modules were modified to zero their output messages in their Reset methods:

  • rwMotorVoltage
  • torque2Dipole
  • dipoleMapping
  • forceTorqueThrForceMapping
  • torqueScheduler
  • thrusterPlatformReference
  • thrusterPlatformState

Each implementation follows the same pattern:

  1. Create a zeroed message payload using the appropriate _zeroMsgPayload() function
  2. Write this zeroed message to the output message structure

Some modules like thrustRWDesat were found to already have the necessary zeroing functionality in place.

Verification

The changes were validated by:

  1. Reviewing each module's code structure to ensure the zeroing functionality was implemented correctly
  2. added unit tests to existing test files for each module to cover the new reset feature
  3. Ensuring consistency in the implementation approach across all modules
  4. Verifying that the zeroing occurs in the Reset method, which is called when modules are disabled
  5. Ensuring all existing unit tests still pass

No new tests were added as this is a safety enhancement to existing functionality. The existing module tests will continue to validate the behavior of these modules.

Documentation

The release notes have been updated to include an entry about this enhancement.
The .rst documentation for all relevant effectors have been updated to mention the zeroing behavior on reset.
No other documentation was invalidated by these changes as they merely enhance existing functionality.

Future work

No immediate future work is anticipated. However, as new effector interface modules are added to the codebase, they should follow this pattern of zeroing output messages in their reset methods to maintain consistent safety behavior.

@Natsoulas Natsoulas requested a review from schaubh February 27, 2025 03:38
@Natsoulas Natsoulas self-assigned this Feb 27, 2025
@Natsoulas Natsoulas requested a review from a team as a code owner February 27, 2025 03:38
@Natsoulas Natsoulas added the enhancement New feature or request label Feb 27, 2025
@Natsoulas Natsoulas moved this to 🏗 In progress in Basilisk Feb 27, 2025
@Natsoulas Natsoulas moved this from 🏗 In progress to 👀 In review in Basilisk Feb 27, 2025
Copy link
Copy Markdown
Contributor

@schaubh schaubh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting close, need to address a few small items. Shouldn't take long.

Comment thread src/fswAlgorithms/effectorInterfaces/dipoleMapping/dipoleMapping.c Outdated
Comment thread docs/source/Support/bskReleaseNotes.rst
Comment thread docs/source/Support/bskReleaseNotes.rst
@Natsoulas Natsoulas force-pushed the feature/817-mechanism-for-zeroing-effector-control-alg-msg-outputs branch from 1ab549d to a04641f Compare February 28, 2025 01:59
@Natsoulas Natsoulas requested a review from schaubh February 28, 2025 02:03
@Natsoulas Natsoulas force-pushed the feature/817-mechanism-for-zeroing-effector-control-alg-msg-outputs branch from a04641f to dbd386b Compare February 28, 2025 04:58
@Natsoulas Natsoulas force-pushed the feature/817-mechanism-for-zeroing-effector-control-alg-msg-outputs branch 4 times, most recently from 844bc0f to a82eb1e Compare April 2, 2025 17:41
Copy link
Copy Markdown
Contributor

@schaubh schaubh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there. Some simple RST formatting fix, and updating the unit tests to check, after the simulation runs, that calling Reset() does zero the module effector output messages. Then we are building this functionality into our unit tests.

Comment thread examples/MultiSatBskSim/modelsMultiSat/BSK_MultiSatFsw.py Outdated
Comment thread src/fswAlgorithms/effectorInterfaces/dipoleMapping/dipoleMapping.rst Outdated
Comment thread src/fswAlgorithms/effectorInterfaces/rwMotorVoltage/rwMotorVoltage.rst Outdated
Comment thread src/fswAlgorithms/effectorInterfaces/thrFiringRemainder/thrFiringRemainder.rst Outdated
Comment thread src/fswAlgorithms/effectorInterfaces/thrustRWDesat/thrustRWDesat.rst Outdated
Comment thread src/fswAlgorithms/effectorInterfaces/torque2Dipole/torque2Dipole.rst Outdated
Comment thread src/fswAlgorithms/effectorInterfaces/torqueScheduler/torqueScheduler.rst Outdated
Comment thread src/fswAlgorithms/effectorInterfaces/dipoleMapping/dipoleMapping.c
@Natsoulas Natsoulas force-pushed the feature/817-mechanism-for-zeroing-effector-control-alg-msg-outputs branch from 9cfde49 to c2f9145 Compare April 3, 2025 23:18
@Natsoulas Natsoulas force-pushed the feature/817-mechanism-for-zeroing-effector-control-alg-msg-outputs branch from c2f9145 to e48942b Compare April 3, 2025 23:29
@Natsoulas Natsoulas requested a review from schaubh April 4, 2025 00:24
Copy link
Copy Markdown
Contributor

@schaubh schaubh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to go.

@Natsoulas Natsoulas merged commit 015d419 into develop Apr 4, 2025
29 of 33 checks passed
@Natsoulas Natsoulas deleted the feature/817-mechanism-for-zeroing-effector-control-alg-msg-outputs branch April 4, 2025 13:58
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Basilisk Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

No easy mechanism for zeroing effector control algorithm message outputs

2 participants