Skip to content

Commit

Permalink
Merge pull request #313 from AVSLab/feature/312-eigen-swig-int-support
Browse files Browse the repository at this point in the history
Feature/312 eigen swig int support
  • Loading branch information
juan-g-bonilla authored May 4, 2023
2 parents 3785298 + f1aabb4 commit b7cf0b1
Show file tree
Hide file tree
Showing 32 changed files with 809 additions and 306 deletions.
1 change: 1 addition & 0 deletions docs/source/Support/bskReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Version |release|
- Bug fix made to :ref:`eclipse`: Saturn, Jupiter, Uranus, and Neptune radii were incorrectly being assigned the
radius of Mars.
- Added custom planet name to :ref:`eclipse` in case the user wants to use a body not contained within the module.
- Removed all instances of using ``unitTestSupport.np2EigenVectorXd()``, as this function is now unneeded.


Version 2.1.7 (March 24, 2023)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def configure_initial_conditions(self):
self.get_FswModel().relativeODData.stateInit = rN.tolist() + vN.tolist()
if self.filterUse == "bias":
self.get_FswModel().pixelLineFilterData.stateInit = rN.tolist() + vN.tolist() + bias
# self.get_DynModel().scObject.hub.r_CN_NInit = unitTestSupport.np2EigenVectorXd(rN) # m - r_CN_N
# self.get_DynModel().scObject.hub.v_CN_NInit = unitTestSupport.np2EigenVectorXd(vN) # m/s - v_CN_N
# self.get_DynModel().scObject.hub.r_CN_NInit = rN # m - r_CN_N
# self.get_DynModel().scObject.hub.v_CN_NInit = vN # m/s - v_CN_N
self.get_DynModel().scObject.hub.sigma_BNInit = [[MRP[0]], [MRP[1]], [MRP[2]]] # sigma_BN_B
self.get_DynModel().scObject.hub.omega_BN_BInit = [[0.0], [0.0], [0.0]] # rad/s - omega_BN_B
self.get_DynModel().cameraMod.fieldOfView = np.deg2rad(55)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def configure_initial_conditions(self):

MRP= [0,-0.3,0]
self.get_FswModel().relativeODData.stateInit = (rN+rError).tolist() + (vN+vError).tolist()
self.get_DynModel().scObject.hub.r_CN_NInit = unitTestSupport.np2EigenVectorXd(rN) # m - r_CN_N
self.get_DynModel().scObject.hub.v_CN_NInit = unitTestSupport.np2EigenVectorXd(vN) # m/s - v_CN_N
self.get_DynModel().scObject.hub.r_CN_NInit = rN # m - r_CN_N
self.get_DynModel().scObject.hub.v_CN_NInit = vN # m/s - v_CN_N
self.get_DynModel().scObject.hub.sigma_BNInit = [[MRP[0]], [MRP[1]], [MRP[2]]] # sigma_BN_B
self.get_DynModel().scObject.hub.omega_BN_BInit = [[0.0], [0.0], [0.0]] # rad/s - omega_BN_B
qNoiseIn = np.identity(6)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def configure_initial_conditions(self):
MRP= [0,0,0]
self.get_FswModel().relativeODData.stateInit = (rN + rError).tolist() + (vN + vError).tolist()

self.get_DynModel().scObject.hub.r_CN_NInit = unitTestSupport.np2EigenVectorXd(rN) # m - r_CN_N
self.get_DynModel().scObject.hub.v_CN_NInit = unitTestSupport.np2EigenVectorXd(vN) # m/s - v_CN_N
self.get_DynModel().scObject.hub.r_CN_NInit = rN # m - r_CN_N
self.get_DynModel().scObject.hub.v_CN_NInit = vN # m/s - v_CN_N
self.get_DynModel().scObject.hub.sigma_BNInit = [[MRP[0]], [MRP[1]], [MRP[2]]] # sigma_BN_B
self.get_DynModel().scObject.hub.omega_BN_BInit = [[0.0], [0.0], [0.0]] # rad/s - omega_BN_B

Expand Down Expand Up @@ -155,4 +155,3 @@ def run(TheScenario):
# Configure a scenario in the base simulation
TheScenario = scenario_OpNav()
run(TheScenario)

4 changes: 2 additions & 2 deletions examples/OpNavScenarios/scenariosOpNav/scenario_CNNAttOD.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def configure_initial_conditions(self):
self.masterSim.get_FswModel().relativeODData.stateInit = (rN + rError).tolist() + (vN + vError).tolist()
if self.filterUse == "bias":
self.masterSim.get_FswModel().relativeODData.stateInit = (rN + rError).tolist() + (vN + vError).tolist() + bias
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = unitTestSupport.np2EigenVectorXd(rN) # m - r_CN_N
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = unitTestSupport.np2EigenVectorXd(vN) # m/s - v_CN_N
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = rN # m - r_CN_N
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = vN # m/s - v_CN_N
self.masterSim.get_DynModel().scObject.hub.sigma_BNInit = [[MRP[0]], [MRP[1]], [MRP[2]]] # sigma_BN_B
self.masterSim.get_DynModel().scObject.hub.omega_BN_BInit = [[0.0], [0.0], [0.0]] # rad/s - omega_BN_B

Expand Down
4 changes: 2 additions & 2 deletions examples/OpNavScenarios/scenariosOpNav/scenario_OpNavAttOD.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def configure_initial_conditions(self):
self.masterSim.get_FswModel().relativeODData.stateInit = (rN + rError).tolist() + (vN + vError).tolist()
if self.filterUse == "bias":
self.masterSim.get_FswModel().relativeODData.stateInit = (rN + rError).tolist() + (vN + vError).tolist() + bias
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = unitTestSupport.np2EigenVectorXd(rN) # m - r_CN_N
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = unitTestSupport.np2EigenVectorXd(vN) # m/s - v_CN_N
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = rN
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = vN
self.masterSim.get_DynModel().scObject.hub.sigma_BNInit = [[MRP[0]], [MRP[1]], [MRP[2]]] # sigma_BN_B
self.masterSim.get_DynModel().scObject.hub.omega_BN_BInit = [[0.0], [0.0], [0.0]] # rad/s - omega_BN_B

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ def configure_initial_conditions(self):

MRP= [0,-0.3,0]
self.masterSim.get_FswModel().relativeODData.stateInit = (rN+rError).tolist() + (vN+vError).tolist()
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = unitTestSupport.np2EigenVectorXd(rN) # m - r_CN_N
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = unitTestSupport.np2EigenVectorXd(vN) # m/s - v_CN_N
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = rN
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = vN
self.masterSim.get_DynModel().scObject.hub.sigma_BNInit = [[MRP[0]], [MRP[1]], [MRP[2]]] # sigma_BN_B
self.masterSim.get_DynModel().scObject.hub.omega_BN_BInit = [[0.0], [0.0], [0.0]] # rad/s - omega_BN_B
qNoiseIn = np.identity(6)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def configure_initial_conditions(self):
self.masterSim.get_FswModel().relativeODData.stateInit = rN.tolist() + vN.tolist()
if self.filterUse == "bias":
self.masterSim.get_FswModel().pixelLineFilterData.stateInit = rN.tolist() + vN.tolist() + bias
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = unitTestSupport.np2EigenVectorXd(rN) # m - r_CN_N
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = unitTestSupport.np2EigenVectorXd(vN) # m/s - v_CN_N
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = rN # m - r_CN_N
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = vN # m/s - v_CN_N
self.masterSim.get_DynModel().scObject.hub.sigma_BNInit = [[MRP[0]], [MRP[1]], [MRP[2]]] # sigma_BN_B
self.masterSim.get_DynModel().scObject.hub.omega_BN_BInit = [[0.0], [0.0], [0.0]] # rad/s - omega_BN_B
# Search
Expand Down
4 changes: 2 additions & 2 deletions examples/OpNavScenarios/scenariosOpNav/scenario_OpNavOD.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def configure_initial_conditions(self):
self.masterSim.get_FswModel().relativeODData.stateInit = rN.tolist() + vN.tolist()
if self.filterUse == "bias":
self.masterSim.get_FswModel().pixelLineFilterData.stateInit = rN.tolist() + vN.tolist() + bias
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = unitTestSupport.np2EigenVectorXd(rN) # m - r_CN_N
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = unitTestSupport.np2EigenVectorXd(vN) # m/s - v_CN_N
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = rN
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = vN
self.masterSim.get_DynModel().scObject.hub.sigma_BNInit = [[MRP[0]], [MRP[1]], [MRP[2]]] # sigma_BN_B
self.masterSim.get_DynModel().scObject.hub.omega_BN_BInit = [[0.0], [0.0], [0.0]] # rad/s - omega_BN_B

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def configure_initial_conditions(self):

MRP= [0,-0.3,0]
self.masterSim.get_FswModel().relativeODData.stateInit = rN.tolist() + vN.tolist()
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = unitTestSupport.np2EigenVectorXd(rN) # m - r_CN_N
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = unitTestSupport.np2EigenVectorXd(vN) # m/s - v_CN_N
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = rN
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = vN
self.masterSim.get_DynModel().scObject.hub.sigma_BNInit = [[MRP[0]], [MRP[1]], [MRP[2]]] # sigma_BN_B
self.masterSim.get_DynModel().scObject.hub.omega_BN_BInit = [[0.0], [0.0], [0.0]] # rad/s - omega_BN_B

Expand Down
4 changes: 2 additions & 2 deletions examples/OpNavScenarios/scenariosOpNav/scenario_OpNavPoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def configure_initial_conditions(self):
self.masterSim.get_FswModel().relativeODData.stateInit = rN.tolist() + vN.tolist()
if self.filterUse == "bias":
self.masterSim.get_FswModel().pixelLineFilterData.stateInit = rN.tolist() + vN.tolist() + bias
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = unitTestSupport.np2EigenVectorXd(rN) # m - r_CN_N
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = unitTestSupport.np2EigenVectorXd(vN) # m/s - v_CN_N
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = rN
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = vN
self.masterSim.get_DynModel().scObject.hub.sigma_BNInit = [[MRP[0]], [MRP[1]], [MRP[2]]] # sigma_BN_B
self.masterSim.get_DynModel().scObject.hub.omega_BN_BInit = [[0.0], [0.0], [0.0]] # rad/s - omega_BN_B
# Search
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def configure_initial_conditions(self):
self.masterSim.get_FswModel().relativeODData.stateInit = rN.tolist() + vN.tolist()
if self.filterUse == "bias":
self.masterSim.get_FswModel().pixelLineFilterData.stateInit = rN.tolist() + vN.tolist() + bias
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = unitTestSupport.np2EigenVectorXd(rN) # m - r_CN_N
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = unitTestSupport.np2EigenVectorXd(vN) # m/s - v_CN_N
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = rN
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = vN
self.masterSim.get_DynModel().scObject.hub.sigma_BNInit = [[MRP[0]], [MRP[1]], [MRP[2]]] # sigma_BN_B
self.masterSim.get_DynModel().scObject.hub.omega_BN_BInit = [[0.0], [0.0], [0.0]] # rad/s - omega_BN_B
# Search
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def configure_initial_conditions(self):

MRP= [0,-0.3,0]
self.masterSim.get_FswModel().relativeODData.stateInit = rN.tolist() + vN.tolist()
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = unitTestSupport.np2EigenVectorXd(rN) # m - r_CN_N
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = unitTestSupport.np2EigenVectorXd(vN) # m/s - v_CN_N
self.masterSim.get_DynModel().scObject.hub.r_CN_NInit = rN # m - r_CN_N
self.masterSim.get_DynModel().scObject.hub.v_CN_NInit = vN # m/s - v_CN_N
self.masterSim.get_DynModel().scObject.hub.sigma_BNInit = [[MRP[0]], [MRP[1]], [MRP[2]]] # sigma_BN_B
self.masterSim.get_DynModel().scObject.hub.omega_BN_BInit = [[0.0], [0.0], [0.0]] # rad/s - omega_BN_B

Expand Down
4 changes: 2 additions & 2 deletions examples/scenarioAlbedo.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,14 @@ def setupCSS(CSS):
T2 = macros.sec2nano(1000.)
# Set second spacecraft states for decrease in altitude
vVt = vVt + [0.0, 375300, 0.0] # m - v_CN_N
velRef.setState(unitTestSupport.np2EigenVectorXd(vVt))
velRef.setState(vVt)
scSim.ConfigureStopTime(T1 + T2)
scSim.ExecuteSimulation()
# get the current spacecraft states
T3 = macros.sec2nano(500.)
# Set second spacecraft states for decrease in altitude
vVt = [0.0, 0.0, 0.0] # m - v_CN_N
velRef.setState(unitTestSupport.np2EigenVectorXd(vVt))
velRef.setState(vVt)
scSim.ConfigureStopTime(T1 + T2 + T3)
scSim.ExecuteSimulation()
simulationTime = T1 + T2 + T3
Expand Down
13 changes: 6 additions & 7 deletions examples/scenarioAsteroidArrival.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def runDvBurn(simTime, burnSign, planetMsg):
# Apply a delta V and set the new velocity state in the circular capture orbit
vHat = vN / np.linalg.norm(vN)
vN = vN + Delta_V_Parking_Orbit * vHat
velRef.setState(unitTestSupport.np2EigenVectorXd(vN))
velRef.setState(vN)

# Travel in a circular orbit at r0, incorporating several attitude pointing modes
runDvBurn(burnTime, -1, velAsteroidGuidanceConfig.attRefOutMsg)
Expand All @@ -634,7 +634,7 @@ def runDvBurn(simTime, burnSign, planetMsg):
vHat = vN / vData
vVt = vN + vHat * (v0p - vData)
# Update state manager's velocity
velRef.setState(unitTestSupport.np2EigenVectorXd(vVt))
velRef.setState(vVt)

# Run thruster burn mode along with sun-pointing during the transfer orbit
runDvBurn(burnTime, -1, velAsteroidGuidanceConfig.attRefOutMsg)
Expand All @@ -652,7 +652,7 @@ def runDvBurn(simTime, burnSign, planetMsg):
vHat = vN / vData
vVt2 = vN + vHat * (v1p - vData)
# Update state manager's velocity
velRef.setState(unitTestSupport.np2EigenVectorXd(vVt2))
velRef.setState(vVt2)

# Run thruster burn visualization along with attitude pointing modes
runDvBurn(burnTime, -1, velAsteroidGuidanceConfig.attRefOutMsg)
Expand All @@ -672,7 +672,7 @@ def runDvBurn(simTime, burnSign, planetMsg):
vHat = vN / vData
vVt = vN + vHat * (v2p - vData)
# Update state manager's velocity
velRef.setState(unitTestSupport.np2EigenVectorXd(vVt))
velRef.setState(vVt)

# Run thruster burn section with science pointing mode
runDvBurn(burnTime, -1, velAsteroidGuidanceConfig.attRefOutMsg)
Expand All @@ -690,7 +690,7 @@ def runDvBurn(simTime, burnSign, planetMsg):
vHat = vN / vData
vVt = vN + vHat * (v3p - vData)
# Update state manager's velocity
velRef.setState(unitTestSupport.np2EigenVectorXd(vVt))
velRef.setState(vVt)

# Run thruster visualization with science pointing mode
runDvBurn(burnTime, -1, velAsteroidGuidanceConfig.attRefOutMsg)
Expand All @@ -708,7 +708,7 @@ def runDvBurn(simTime, burnSign, planetMsg):
vHat = vN / vData
vVt = vN + vHat * (v3p - vData)
# Update state manager's velocity
velRef.setState(unitTestSupport.np2EigenVectorXd(vVt))
velRef.setState(vVt)

# Run thruster visualization with science-pointing mode
runDvBurn(burnTime, -1, velAsteroidGuidanceConfig.attRefOutMsg)
Expand Down Expand Up @@ -776,4 +776,3 @@ def plotOrbits(timeAxis, posData1, posData2, rP, diam):
run(
True # show_plots
)

4 changes: 2 additions & 2 deletions examples/scenarioGroundMapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def run(show_plots, useCentral):
groundMap = groundMapping.GroundMapping()
groundMap.ModelTag = "groundMapping"
for map_idx in range(N):
groundMap.addPointToModel(unitTestSupport.np2EigenVectorXd(mapping_points[map_idx,:]))
groundMap.addPointToModel(mapping_points[map_idx,:])
groundMap.minimumElevation = np.radians(45.)
groundMap.maximumRange = 1e9
groundMap.cameraPos_B = [0, 0, 0]
Expand Down Expand Up @@ -431,4 +431,4 @@ def run(show_plots, useCentral):
run(
True, # show_plots
True
)
)
3 changes: 1 addition & 2 deletions examples/scenarioJupiterArrival.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def run(show_plots):
# Apply delta V and set new velocity state
vHat = vN / np.linalg.norm(vN)
vN = vN + Delta_V_Parking_Orbit*vHat
velRef.setState(unitTestSupport.np2EigenVectorXd(vN))
velRef.setState(vN)

# Run the simulation for 2nd chunk
scSim.ConfigureStopTime(simulationTime + macros.sec2nano(300000))
Expand Down Expand Up @@ -303,4 +303,3 @@ def plotOrbits(timeAxis, posData, jupiter, a_park, e_park):
run(
True # show_plots
)

8 changes: 4 additions & 4 deletions examples/scenarioOrbitManeuver.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def run(show_plots, maneuverCase):
vVt = vVt - (1. - np.cos(Delta_i)) * v0 * vHat + np.sin(Delta_i) * v0 * hHat

# After computing the maneuver specific Delta_v's, the state managers velocity is updated through
velRef.setState(unitTestSupport.np2EigenVectorXd(vVt))
velRef.setState(vVt)
T2 = macros.sec2nano(P * 0.25)
else:
# Hohmann Transfer to GEO
Expand All @@ -253,7 +253,7 @@ def run(show_plots, maneuverCase):
vHat = vVt / v0
vVt = vVt + vHat * (v0p - v0)
# After computing the maneuver specific Delta_v's, the state managers velocity is updated through
velRef.setState(unitTestSupport.np2EigenVectorXd(vVt))
velRef.setState(vVt)

# To start up the simulation again, note that the total simulation time must be provided,
# not just the next incremental simulation time.
Expand All @@ -274,7 +274,7 @@ def run(show_plots, maneuverCase):
vHat = np.cross(hHat, rHat)
v0 = np.dot(vHat, vVt)
vVt = vVt - (1. - np.cos(Delta_i)) * v0 * vHat + np.sin(Delta_i) * v0 * hHat
velRef.setState(unitTestSupport.np2EigenVectorXd(vVt))
velRef.setState(vVt)
T3 = macros.sec2nano(P * 0.25)
else:
# Hohmann Transfer to GEO
Expand All @@ -284,7 +284,7 @@ def run(show_plots, maneuverCase):
T3 = macros.sec2nano(0.25 * (np.pi) / n1)
vHat = vVt / v1
vVt = vVt + vHat * (v1p - v1)
velRef.setState(unitTestSupport.np2EigenVectorXd(vVt))
velRef.setState(vVt)

# run simulation for 3rd chunk
scSim.ConfigureStopTime(simulationTime + T2 + T3)
Expand Down
10 changes: 5 additions & 5 deletions examples/scenarioPatchedConics.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def run(show_plots):
v_S_E = v_S_E + vHat * deltaV1

vN = v_S_E + vel_N_Earth
velRef.setState(unitTestSupport.np2EigenVectorXd(vN))
velRef.setState(vN)

# run simulation for 2nd chunk
scSim.ConfigureStopTime(simulationTime + macros.sec2nano(110000))
Expand Down Expand Up @@ -291,8 +291,8 @@ def run(show_plots):
depVel_N_Earth = [29.7859 * 1000, 0, 0]
rN = rN + pos_N_Earth
vN = vN + depVel_N_Earth
posRef.setState(unitTestSupport.np2EigenVectorXd(rN))
velRef.setState(unitTestSupport.np2EigenVectorXd(vN))
posRef.setState(rN)
velRef.setState(vN)

scSim.ConfigureStopTime(simulationTime + macros.sec2nano(110000) + T2 - oneWeek*1)
scSim.ExecuteSimulation()
Expand Down Expand Up @@ -348,8 +348,8 @@ def run(show_plots):
rN = rN - pos_N_Jup
vN = vN - vel_N_Jup

posRef.setState(unitTestSupport.np2EigenVectorXd(rN))
velRef.setState(unitTestSupport.np2EigenVectorXd(vN))
posRef.setState(rN)
velRef.setState(vN)

# Setup data logging before the simulation is initialized

Expand Down
4 changes: 2 additions & 2 deletions examples/scenarioRendezVous.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def relOrbDrift():
rho_Prime_H[0] = 0.0
rho_Prime_H[1] = -1.5*n*xOff
unusedPos, vd = orbitalMotion.hill2rv(rc, vc, rho_H, rho_Prime_H)
servicerVel.setState(unitTestSupport.np2EigenVectorXd(vd))
servicerVel.setState(vd)

def relativeEllipse(A0, xOff, B0=-1):
rd = unitTestSupport.EigenVector3d2np(servicerPos.getState())
Expand All @@ -516,7 +516,7 @@ def relativeEllipse(A0, xOff, B0=-1):
if B0 >= 0.0:
rho_Prime_H[2] = -B0*n*np.sin(beta)
unusedPos, vd = orbitalMotion.hill2rv(rc, vc, rho_H, rho_Prime_H)
servicerVel.setState(unitTestSupport.np2EigenVectorXd(vd))
servicerVel.setState(vd)

#
# configure a simulation stop time and execute the simulation run
Expand Down
4 changes: 2 additions & 2 deletions examples/scenarioSmallBodyNav.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def run(show_plots):
x_0[3:6] = np.array([1.475, -0.176, 0.894])
x_0[6:9] = np.array([-0.58, 0.615, 0.125])
x_0[11] = 0.0004
smallBodyNav.x_hat_k = unitTestSupport.np2EigenVectorXd(x_0)
smallBodyNav.x_hat_k = x_0
# Set the covariance to something large
smallBodyNav.P_k = (0.1*np.identity(12)).tolist()

Expand Down Expand Up @@ -886,4 +886,4 @@ def run(show_plots):
if __name__ == "__main__":
run(
True # show_plots
)
)
4 changes: 2 additions & 2 deletions examples/scenarioSmallBodyNavUKF.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def run(show_plots):
x_0 = np.zeros(9)
x_0[0:3] = r_CA_A
x_0[3:6] = v_CA_A - np.cross(omega_AN_A,r_CA_A)
smallBodyNav.x_hat_k = unitTestSupport.np2EigenVectorXd(x_0)
smallBodyNav.x_hat_k = x_0

# set the initial state covariance
P_k_pos = 1e4
Expand Down Expand Up @@ -598,4 +598,4 @@ def run(show_plots):
if __name__ == "__main__":
run(
True # show_plots
)
)
2 changes: 1 addition & 1 deletion examples/scenarioSpacecraftLocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def run(show_plots):
scLocation.primaryScStateInMsg.subscribeTo(scObject.scStateOutMsg)
scLocation.rEquator = earth.radEquator
scLocation.rPolar = earth.radEquator*0.98
scLocation.aHat_B = unitTestSupport.np2EigenVectorXd([0, 1, 0])
scLocation.aHat_B = [0, 1, 0]
scLocation.theta = np.radians(10.)
scLocation.maximumRange = 55.
scSim.AddModelToTask(simTaskName, scLocation)
Expand Down
Loading

0 comments on commit b7cf0b1

Please sign in to comment.