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

Feature/bsk 462 rounding #476

Merged
merged 2 commits into from
Nov 1, 2023
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
1 change: 1 addition & 0 deletions docs/source/Support/bskReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Version |release|
- Fixed a bug in the conanfile where the ``stderr`` output from a ``subprocess.Popen`` call was being interpreted as an
error. Rather, the process return code (0 for success, and anything else for failure) indicates the success.
- The ``MAX_N_CSS_MEAS`` define is increased to 32 matching the maximum number of coarse sun sensors.
- mixed bug in time to nano-seconds conversions in ``macros.py`` support file


Version 2.2.0 (June 28, 2023)
Expand Down
2 changes: 1 addition & 1 deletion examples/BskSim/scenarios/scenario_AttModes.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def runScenario(scenario):
attitudeModeTime = macros.min2nano(10.)
attitudeMode = ["hillPoint", "inertial3D"]

currentSimulationTime = 0.
currentSimulationTime = 0
while currentSimulationTime < simulationTime:

# Configure alternating FSW mode
Expand Down
11 changes: 8 additions & 3 deletions src/utilities/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,30 @@

import math


# function to convert seconds to an integer nanoseconds value
def sec2nano(time):
"""convert seconds to nano-seconds"""
return int(time*1E9+0.5)


# function to convert minutes to an integer nanoseconds value
def min2nano(time):
"convert minutes to nano-seconds"
return int((time*1E9+0.5)*60)
return int(time*1E9*60 + 0.5)


# function to convert hours to an integer nanoseconds value
def hour2nano(time):
"""convert hours to nano-seconds"""
return int((time*1E9+0.5)*60*60)
return int(time*1E9*60*60 + 0.5)


# function to convert days to an integer nanoseconds value
def day2nano(time):
"""convert days to nano-seconds"""
return int((time*1E9+0.5)*60*60*24)
return int(time*1E9*60*60*24 + 0.5)


# variable to convert nano-seconds to seconds
NANO2SEC = 1E-9
Expand Down
Loading