Skip to content

Conversation

@leahkiner
Copy link
Contributor

@leahkiner leahkiner commented Nov 26, 2025

Description

This PR adds optional prescribed 1-DOF helical screw motion to the prescribedRotation1DOF module, where translation and rotation are both profiled about a single axis.

A c_screw scaling term is added to the module along with a rhoInit translational displacement term, both of which must be set by the user to configure this option.

The translational states are coupled with the rotational states through the c_screw slope constant. The rotational profile is scaled by the slope constant to generate the translational states. If this option is enabled, the module outputs both the PrescribedRotationMsgPayload message and an additional PrescribedTranslationMsgPayload message.

Verification

An example scenarioPrescribedScrewMotion scenario is added to the examples folder. The original prescribedRotation1DOF module unit test is not modified for this minor change.

Documentation

The prescribedRotation1DOF module documentation is updated to describe how to configure this option.

Future work

N/A

@leahkiner leahkiner requested a review from schaubh November 26, 2025 00:22
@leahkiner leahkiner self-assigned this Nov 26, 2025
@leahkiner leahkiner requested a review from a team as a code owner November 26, 2025 00:22
@leahkiner leahkiner added the enhancement New feature or request label Nov 26, 2025
@leahkiner leahkiner moved this to 👀 In review in Basilisk Nov 26, 2025
@leahkiner leahkiner force-pushed the feature/1176-prescribed-screw-motion branch from f52076f to 72bf7f0 Compare November 26, 2025 00:26
@leahkiner leahkiner linked an issue Nov 26, 2025 that may be closed by this pull request
@schaubh schaubh changed the title Feature/1176 prescribed screw motion Add prescribed screw motion of a dynamic sub-component Nov 27, 2025
Otherwise the font in the HTML figures look far too large.  Using default font sizes makes the documentation figures at least look consistent.
Copy link
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.

Very nice PR! Only some small things to look at. I pushed two commits that start with [squash] that address two RST formatting changes I'd like. Should all be very quick to apply.


if (this->c_screw != 0.0) {
// Write the prescribed translation output message if screw motion is configured
PrescribedTranslationMsgPayload prescribedTranslationOut;
Copy link
Contributor

Choose a reason for hiding this comment

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

You can write
PrescribedTranslationMsgPayload prescribedTranslationOut = {} to define this variable and have the structure zero'd in one step.

if (this->c_screw != 0.0) {
// Write the prescribed translation output message if screw motion is configured
PrescribedTranslationMsgPayload prescribedTranslationOut;
prescribedTranslationOut = PrescribedTranslationMsgPayload();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can remove this line if you implement the above suggestion.

--------
This scenario demonstrates how to configure prescribed helical screw motion using the
prescribedRotation1DOF kinematic profiler module with the prescribedMotionStateEffector module.
Copy link
Contributor

Choose a reason for hiding this comment

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

the BSK module names can be hyperlinks to the corresponding HTML documentation. I pushed a commit that does this. You can merge this commit with this commit.

plt.plot(prescribed_theta_1[1:], prescribed_rho_1_truth[1:], '--', label=r'$P_1$ Truth', color="teal")
plt.plot(prescribed_theta_2[1:], prescribed_rho_2[1:], label=r'$P_2$ Sim', color="darkviolet")
plt.plot(prescribed_theta_2[1:], prescribed_rho_2_truth[1:], '--', label=r'$P_2$ Truth', color="darkviolet")
plt.title(r'Prescribed Displacements VS Angles', fontsize=16)
Copy link
Contributor

Choose a reason for hiding this comment

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

I pushed a commit that removes all non-default font sizes. The text was too large, and the figures didn't look consistent with the rest of the documentation. I prefer for example scripts to use default fonts unless there is a strong need.

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: 👀 In review

Development

Successfully merging this pull request may close these issues.

Add prescribed screw motion to prescribedRotation1DOF module

3 participants