From 0c4d256ec20e69f27b66a9225b9027fcf9d84af6 Mon Sep 17 00:00:00 2001 From: Hanspeter Schaub Date: Mon, 15 Jun 2026 08:21:27 -0600 Subject: [PATCH 1/2] [#1419] Fix linear translation NDOF getter assertion Update the getTranslatingBody() assertion to use the linear translation effector's translating-body count instead of the spinning-body-only degree-of-freedom member. Add the required release note snippet and known-issues entry for the source-build fix. --- docs/source/Support/bskKnownIssues.rst | 2 ++ .../linear-translation-ndof-getter-build.rst | 1 + .../linearTranslationNDOFStateEffector.cpp | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 docs/source/Support/bskReleaseNotesSnippets/linear-translation-ndof-getter-build.rst diff --git a/docs/source/Support/bskKnownIssues.rst b/docs/source/Support/bskKnownIssues.rst index d9de4506f30..633fd79eb12 100644 --- a/docs/source/Support/bskKnownIssues.rst +++ b/docs/source/Support/bskKnownIssues.rst @@ -24,6 +24,8 @@ Version |release| 3.7 upgrade. - Monte Carlo now applies nested dispersion paths and randomized ``RNGSeed`` modifications to the actual simulation objects. +- The :ref:`linearTranslationNDOFStateEffector` getter assertion no longer references the spinning-body-only + degree-of-freedom counter, fixing source builds where that assertion is compiled. - SWIG 4.4.0 caused Basilisk build failures in some Python 3.13+ source-build configurations. Basilisk now requires SWIG 4.4.1 or a newer supported 4.x release, which provides SWIG ABI 5 support for Basilisk and compatible plugins. If source builds fail with SWIG 4.4.0 or emit diff --git a/docs/source/Support/bskReleaseNotesSnippets/linear-translation-ndof-getter-build.rst b/docs/source/Support/bskReleaseNotesSnippets/linear-translation-ndof-getter-build.rst new file mode 100644 index 00000000000..aac142fec0f --- /dev/null +++ b/docs/source/Support/bskReleaseNotesSnippets/linear-translation-ndof-getter-build.rst @@ -0,0 +1 @@ +- Fixed a source-build error in :ref:`linearTranslationNDOFStateEffector` from an invalid getter assertion. diff --git a/src/simulation/dynamics/linearTranslationalBodies/linearTranslationBodiesNDOF/linearTranslationNDOFStateEffector.cpp b/src/simulation/dynamics/linearTranslationalBodies/linearTranslationBodiesNDOF/linearTranslationNDOFStateEffector.cpp index 06631b1221a..dd041982987 100644 --- a/src/simulation/dynamics/linearTranslationalBodies/linearTranslationBodiesNDOF/linearTranslationNDOFStateEffector.cpp +++ b/src/simulation/dynamics/linearTranslationalBodies/linearTranslationBodiesNDOF/linearTranslationNDOFStateEffector.cpp @@ -110,7 +110,7 @@ void LinearTranslationNDOFStateEffector::addTranslatingBody(const std::shared_pt /*! This method is used to get a translating body. */ std::shared_ptr LinearTranslationNDOFStateEffector::getTranslatingBody(uint64_t index) { - assert(("Index can't be greater than the number of degrees of freedom of the effector", index <= this->numberOfDegreesOfFreedom)); + assert(("Index must be less than the number of translating body axes", index < static_cast(this->N))); return this->translatingBodyVec.at(index); } From 2e187f4f07e3c4ed22d125f31e3c52f114d83196 Mon Sep 17 00:00:00 2001 From: Hanspeter Schaub Date: Mon, 15 Jun 2026 09:01:07 -0600 Subject: [PATCH 2/2] [#1419] Fix N-DoF state effector getter assertions Correct the linear translation N-DoF getter assertion to use the linear effector body count instead of the spinning-body-only degree of freedom member. Also tighten the spinning body N-DoF getter assertion to reject the first out-of-range zero-based index. Update the release note snippet and known issues entry for both getter assertion fixes. --- docs/source/Support/bskKnownIssues.rst | 3 ++- .../linear-translation-ndof-getter-build.rst | 2 +- .../spinningBodiesNDOF/spinningBodyNDOFStateEffector.cpp | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/source/Support/bskKnownIssues.rst b/docs/source/Support/bskKnownIssues.rst index 633fd79eb12..36e30d94543 100644 --- a/docs/source/Support/bskKnownIssues.rst +++ b/docs/source/Support/bskKnownIssues.rst @@ -25,7 +25,8 @@ Version |release| - Monte Carlo now applies nested dispersion paths and randomized ``RNGSeed`` modifications to the actual simulation objects. - The :ref:`linearTranslationNDOFStateEffector` getter assertion no longer references the spinning-body-only - degree-of-freedom counter, fixing source builds where that assertion is compiled. + degree-of-freedom counter, fixing source builds where that assertion is compiled. The related + :ref:`spinningBodyNDOFStateEffector` getter assertion now rejects the first out-of-range index. - SWIG 4.4.0 caused Basilisk build failures in some Python 3.13+ source-build configurations. Basilisk now requires SWIG 4.4.1 or a newer supported 4.x release, which provides SWIG ABI 5 support for Basilisk and compatible plugins. If source builds fail with SWIG 4.4.0 or emit diff --git a/docs/source/Support/bskReleaseNotesSnippets/linear-translation-ndof-getter-build.rst b/docs/source/Support/bskReleaseNotesSnippets/linear-translation-ndof-getter-build.rst index aac142fec0f..13e81c6f5b7 100644 --- a/docs/source/Support/bskReleaseNotesSnippets/linear-translation-ndof-getter-build.rst +++ b/docs/source/Support/bskReleaseNotesSnippets/linear-translation-ndof-getter-build.rst @@ -1 +1 @@ -- Fixed a source-build error in :ref:`linearTranslationNDOFStateEffector` from an invalid getter assertion. +- Fixed N-DoF getter assertions in :ref:`linearTranslationNDOFStateEffector` and :ref:`spinningBodyNDOFStateEffector`. diff --git a/src/simulation/dynamics/spinningBodies/spinningBodiesNDOF/spinningBodyNDOFStateEffector.cpp b/src/simulation/dynamics/spinningBodies/spinningBodiesNDOF/spinningBodyNDOFStateEffector.cpp index a187de8d894..fb69f9f17ff 100644 --- a/src/simulation/dynamics/spinningBodies/spinningBodiesNDOF/spinningBodyNDOFStateEffector.cpp +++ b/src/simulation/dynamics/spinningBodies/spinningBodiesNDOF/spinningBodyNDOFStateEffector.cpp @@ -113,7 +113,8 @@ void SpinningBodyNDOFStateEffector::addSpinningBody(const std::shared_ptr SpinningBodyNDOFStateEffector::getSpinningBody(uint64_t index) { - assert(("Index can't be greater than the number of degrees of freedom of the effector", index <= this->numberOfDegreesOfFreedom)); + assert(("Index must be less than the number of degrees of freedom of the effector", + index < static_cast(this->numberOfDegreesOfFreedom))); return this->spinningBodyVec.at(index); }