Skip to content

Fix two bugs in 1DOF Hinged Body Code and the Integrated Test#1357

Merged
andrewmorell merged 2 commits into
developfrom
refactor/1dof-hrb
Apr 22, 2026
Merged

Fix two bugs in 1DOF Hinged Body Code and the Integrated Test#1357
andrewmorell merged 2 commits into
developfrom
refactor/1dof-hrb

Conversation

@DavilaDawg
Copy link
Copy Markdown
Contributor

@DavilaDawg DavilaDawg commented Apr 14, 2026

  • Review: By commit
  • Merge strategy: Merge (no squash)

Description

This fixes a bug with effector branching in the hingedRigidBodies (HRB) effector. In the effector branching integrated test, the HRB cases used a special conditional applied to retrieving the r_ScN_N_log. That conditional turned out to be unnecessary due to a misunderstanding in what points are referred to as H, S, and Sc. In spinning bodies modules, the center of mass location is referred to Sc and an S frame fixed point S is coincident with an H frame fixed point H. In the HRB modules, point S is instead the center of mass location, but was being assumed coincident with point H. The underlying issue was that the module was tracking the panel center of mass (COM) quantities, r_SN_N and v_SN_N, when it meant to track the hinge point quantities, r_HN_N and v_HN_N. With the hinge point states now handled correctly, the extra conditional in the integrated test is no longer needed, and the test behavior matches the intended 1DOF HRB dynamics for the right reason.

Verification

The test previously passed due to two bugs offsetting each other making the dynamics appear correct even though the implementation was not. The effector was tracking HRB COM instead of hinge location, and the integrated test subtracted off the vector between hinge and COM. The integrated test: test_effectorBranching_integrated.py now still passes, but without subtracting off this intermediate vector since the effector branching now accurately tracks the hinge point itself. Pytest was also run confirming all 36 branching test cases pass. Additional uncommitted validation was performed using Vizard and a 1DOF HRB scenario.

Documentation

No documentation was invalidated by these changes. Some comments are added when defining new variables in the HingedRigidBodyStateEffector header file.

Future work

This change is inherently rolled into the incoming HRB 2DOF and NDOF module changes for branching.

@DavilaDawg DavilaDawg requested a review from a team as a code owner April 14, 2026 21:00
@DavilaDawg DavilaDawg changed the title Refactor/1dof hrb Fix two bugs in 1DOF Hinged Body Code and the Integrated Test Apr 14, 2026
@DavilaDawg DavilaDawg self-assigned this Apr 21, 2026
Copy link
Copy Markdown
Contributor

@andrewmorell andrewmorell left a comment

Choose a reason for hiding this comment

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

I think just one small change needed, a variable when calculating v_SN_N was changed that should remain the same.

Comment thread src/simulation/dynamics/HingedRigidBodies/hingedRigidBodyStateEffector.cpp Outdated
@andrewmorell
Copy link
Copy Markdown
Contributor

@codex review

@AVSLab AVSLab deleted a comment from chatgpt-codex-connector Bot Apr 21, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@andrewmorell andrewmorell self-requested a review April 22, 2026 01:28
Copy link
Copy Markdown
Contributor

@andrewmorell andrewmorell left a comment

Choose a reason for hiding this comment

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

All looks good now!

@andrewmorell andrewmorell added the bug Something isn't working label Apr 22, 2026
@andrewmorell andrewmorell moved this to ✅ Done in Basilisk Apr 22, 2026
@andrewmorell andrewmorell merged commit f49e13a into develop Apr 22, 2026
7 checks passed
@andrewmorell andrewmorell deleted the refactor/1dof-hrb branch April 22, 2026 01:57
@andrewmorell andrewmorell self-assigned this May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants