-
Notifications
You must be signed in to change notification settings - Fork 91
Add prescribed screw motion of a dynamic sub-component #1200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
leahkiner
wants to merge
7
commits into
develop
Choose a base branch
from
feature/1176-prescribed-screw-motion
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2ac0a7b
Configure prescribedRotation1DOF for optional screw motion
leahkiner c68520d
Add example scenario for prescribed screw motion
leahkiner 129053a
Update documentation for optional helical screw motion
leahkiner e49169a
Comment file save in prescribed motion branching scenarios
leahkiner 72bf7f0
Update bskReleaseNotes
leahkiner 2fedf63
[squash] add hyperlinks to the BSK module used
schaubh 1510ce1
[squash] use default font size
schaubh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ | |
| void PrescribedRotation1DOF::SelfInit() { | ||
| HingedRigidBodyMsg_C_init(&this->spinningBodyOutMsgC); | ||
| PrescribedRotationMsg_C_init(&this->prescribedRotationOutMsgC); | ||
| PrescribedTranslationMsg_C_init(&this->prescribedTranslationOutMsgC); | ||
| } | ||
|
|
||
| /*! This method resets required module variables and checks the input messages to ensure they are linked. | ||
|
|
@@ -663,6 +664,19 @@ void PrescribedRotation1DOF::writeOutputMessages(uint64_t callTime) { | |
| this->prescribedRotationOutMsg.write(&prescribedRotationOut, moduleID, callTime); | ||
| HingedRigidBodyMsg_C_write(&spinningBodyOut, &spinningBodyOutMsgC, this->moduleID, callTime); | ||
| PrescribedRotationMsg_C_write(&prescribedRotationOut, &prescribedRotationOutMsgC, this->moduleID, callTime); | ||
|
|
||
| if (this->c_screw != 0.0) { | ||
| // Write the prescribed translation output message if screw motion is configured | ||
| PrescribedTranslationMsgPayload prescribedTranslationOut; | ||
| prescribedTranslationOut = PrescribedTranslationMsgPayload(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can remove this line if you implement the above suggestion. |
||
| Eigen::Vector3d r_PM_M = (this->rhoInit + this->c_screw * this->theta) * this->rotHat_M; | ||
| Eigen::Vector3d rPrime_PM_M = this->c_screw * this->thetaDot * this->rotHat_M; | ||
| Eigen::Vector3d rPrimePrime_PM_M = this->c_screw * this->thetaDDot * this->rotHat_M; | ||
| eigenVector3d2CArray(r_PM_M, prescribedTranslationOut.r_PM_M); | ||
| eigenVector3d2CArray(rPrime_PM_M, prescribedTranslationOut.rPrime_PM_M); | ||
| eigenVector3d2CArray(rPrimePrime_PM_M, prescribedTranslationOut.rPrimePrime_PM_M); | ||
| this->prescribedTranslationOutMsg.write(&prescribedTranslationOut, moduleID, callTime); | ||
| } | ||
| } | ||
|
|
||
| /*! This method computes the current spinning body MRP attitude relative to the mount frame: sigma_PM | ||
|
|
@@ -768,3 +782,33 @@ double PrescribedRotation1DOF::getThetaDDotMax() const { | |
| double PrescribedRotation1DOF::getThetaInit() const { | ||
| return this->thetaInit; | ||
| } | ||
|
|
||
| /*! Setter method for the initial linear displacement if screw motion is selected. | ||
|
|
||
| @param initDisplacement Initial linear displacement | ||
| */ | ||
| void PrescribedRotation1DOF::setInitDisplacement(const double initDisplacement) { | ||
| this->rhoInit = initDisplacement; | ||
| } | ||
|
|
||
| /*! Setter method for the screw constant for modeling prescribed screw motion. | ||
|
|
||
| @param screwConstant Screw slope constant | ||
| */ | ||
| void PrescribedRotation1DOF::setScrewConstant(const double screwConstant) { | ||
| this->c_screw = screwConstant; | ||
| } | ||
|
|
||
| /*! Getter method for the initial linear displacement if screw motion is selected. | ||
| @return double | ||
| */ | ||
| double PrescribedRotation1DOF::getInitDisplacement() const { | ||
| return this->rhoInit; | ||
| } | ||
|
|
||
| /*! Getter method for the screw constant. | ||
| @return double | ||
| */ | ||
| double PrescribedRotation1DOF::getScrewConstant() const { | ||
| return this->c_screw; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.