Skip to content
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

simIncludeRW didn't allow specify certain RW friction parameters #816

Merged
merged 3 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/source/Support/bskKnownIssues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Version |release|
- Installing Basilisk 2.4.0 while ``packaging<22`` is installed can lead to an incompatibility and raise a
"TypeError: ``canonicalize_version()`` got an unexpected keyword argument ``strip_trailing_zero``" error.
Newer versions of Basilisk now upgrade ``packaging>=22`` to solve this issue.

- :ref:`simIncludeRW` didn't allow ``fCoulomb``, ``fStatic`` and ``cViscous`` to be
specified even if a prebuilt RW data set is used. This is corrected in the current release.

Version 2.4.0
-------------
Expand Down
2 changes: 2 additions & 0 deletions docs/source/Support/bskReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Version |release|
- Made sure that :ref:`astroFunctions` and :ref:`simIncludeGravBody` now all pull from the same set of
astronautical data in :ref:`astroConstants`. These tools now all use a consisten set of planet data
referenced from NASA sources.
- Updated :ref:`simIncludeRW` to allow values of ``fCoulomb``, ``fStatic`` and ``cViscous`` to be
specified even if a prebuilt RW data set is used.
- If ``messaging`` was not imported then the msg ``recorder()`` modules couldn't be setup. Now
``messaging`` is imported as part of the Basilisk package so the ``recorder()`` modules always work.
- Added the ability for GitHub to rebuild the BSK documentation each time a branch is merged back into develop.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,19 @@ def reactionWheelIntegratedTest(show_plots,useFlag,testCase):
,rWB_B = [0.1,0.,0.] # m
,maxMomentum = varMaxMomentum
,RWModel= varRWModel
,fCoulomb=10
,fStatic=5
,cViscous=3
,useRWfriction=True
)
assert rwFactory.rwList["RW1"].fCoulomb == 10, "wasn't able to set custom fCoulomb value"
assert rwFactory.rwList["RW1"].fStatic == 5, "wasn't able to set custom fStatic value"
assert rwFactory.rwList["RW1"].cViscous == 3, "wasn't able to set custom cViscous value"
# reset RW values to continue the test
rwFactory.rwList["RW1"].fCoulomb = 0.0
rwFactory.rwList["RW1"].fStatic = 0.0
rwFactory.rwList["RW1"].cViscous = 0.0

rwFactory.create(
'Honeywell_HR16',
[0,1,0] # gsHat_B
Expand Down Expand Up @@ -533,6 +545,6 @@ def test_setJs(show_plots):


if __name__ == "__main__":
reactionWheelIntegratedTest(True,True,'BalancedWheels')
# reactionWheelIntegratedTest(True,True,'BalancedWheels')
# reactionWheelIntegratedTest(True,True,'BalancedWheels')
test_setJs(False)
schaubh marked this conversation as resolved.
Show resolved Hide resolved
# test_setJs(False)
45 changes: 18 additions & 27 deletions src/utilities/simIncludeRW.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,24 +142,6 @@ def create(self, rwType, gsHat_B, **kwargs):
varMaxPower = -1.0 # default value turns off max power limit
RW.P_max = varMaxPower

if 'fCoulomb' in kwargs:
varfCoulomb = kwargs['fCoulomb']
if not isinstance(varfCoulomb, float):
print('ERROR: fCoulomb must be a FLOAT argument')
exit(1)
else:
varfCoulomb = 0.0 # default value
RW.fCoulomb = varfCoulomb

if 'fStatic' in kwargs:
varfStatic = kwargs['fStatic']
if not isinstance(varfStatic, float):
print('ERROR: fStatic must be a FLOAT argument')
exit(1)
else:
varfStatic = 0.0 # default value
RW.fStatic = varfStatic

if 'betaStatic' in kwargs:
varbetaStatic = kwargs['betaStatic']
if not isinstance(varbetaStatic, float):
Expand All @@ -172,15 +154,6 @@ def create(self, rwType, gsHat_B, **kwargs):
varbetaStatic = -1.0 # default value turns off Stribeck friction model
RW.betaStatic = varbetaStatic

if 'cViscous' in kwargs:
varcViscous = kwargs['cViscous']
if not isinstance(varcViscous, float):
print('ERROR: cViscous must be a FLOAT argument')
exit(1)
else:
varcViscous = 0.0 # default value
RW.cViscous = varcViscous

# set device label name
if 'label' in kwargs:
varLabel = kwargs['label']
Expand All @@ -201,6 +174,24 @@ def create(self, rwType, gsHat_B, **kwargs):
print('ERROR: RW type ' + rwType + ' is not implemented')
exit(1)

if 'fCoulomb' in kwargs:
RW.fCoulomb = kwargs['fCoulomb']
if not isinstance(RW.fCoulomb, float):
print('ERROR: fCoulomb must be a FLOAT argument')
exit(1)

if 'fStatic' in kwargs:
RW.fStatic = kwargs['fStatic']
if not isinstance(RW.fStatic, float):
print('ERROR: fStatic must be a FLOAT argument')
exit(1)

if 'cViscous' in kwargs:
RW.cViscous = kwargs['cViscous']
if not isinstance(RW.cViscous, float):
print('ERROR: cViscous must be a FLOAT argument')
exit(1)

if 'u_min' in kwargs:
varu_min = kwargs['u_min']
if not isinstance(varu_min, float):
Expand Down
Loading