Skip to content

Commit

Permalink
Merge pull request #476 from AVSLab/feature/BSK-462-rounding
Browse files Browse the repository at this point in the history
Feature/bsk 462 rounding
  • Loading branch information
schaubh authored Nov 1, 2023
2 parents a9c47c9 + 532ba95 commit ec3d4d8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
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

0 comments on commit ec3d4d8

Please sign in to comment.