-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mission cases folder and remove boot cases
- Loading branch information
Showing
8 changed files
with
237 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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 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 was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .startup import SingleSatStartupCase, DualSatStartupCase | ||
from .detumble import SingleSatDetumbleCase, DualSatDetumbleCase | ||
from .standby import SingleSatStandbyCase, DualSatStandbyCase |
This file contains 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from ..base import DualSatCase, SingleSatCase, PSimCase | ||
from .utils import log_fc_data, log_psim_data | ||
|
||
|
||
class SingleSatDetumbleCase(SingleSatCase, PSimCase): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(SingleSatDetumbleCase, self).__init__(*args, **kwargs) | ||
|
||
self.psim_configs += ["truth/detumble"] | ||
self.initial_state = "detumble" | ||
self.skip_deployment_wait = True | ||
|
||
def run(self): | ||
if not self.is_interactive: | ||
self.finish() | ||
return | ||
|
||
log_fc_data(self.flight_controller) | ||
log_psim_data(self, "leader") | ||
|
||
self.cycle() | ||
|
||
|
||
class DualSatDetumbleCase(DualSatCase, PSimCase): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(DualSatDetumbleCase, self).__init__(*args, **kwargs) | ||
|
||
self.psim_configs += ["truth/detumble"] | ||
self.leader_initial_state = "detumble" | ||
self.follower_initial_state = "detumble" | ||
self.leader_skip_deployment_wait = True | ||
self.follower_skip_deployment_wait = True | ||
|
||
def run(self): | ||
if not self.is_interactive: | ||
self.finish() | ||
return | ||
|
||
log_fc_data(self.flight_controller_leader) | ||
log_fc_data(self.flight_controller_follower) | ||
log_psim_data(self, "leader", "follower") | ||
|
||
self.cycle() |
This file contains 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from ..base import DualSatCase, SingleSatCase, PSimCase | ||
from ..utils import TestCaseFailure | ||
from .utils import log_fc_data, log_psim_data | ||
|
||
import lin | ||
|
||
|
||
class SingleSatStandbyCase(SingleSatCase, PSimCase): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(SingleSatStandbyCase, self).__init__(*args, **kwargs) | ||
|
||
self.psim_configs += ["truth/standby"] | ||
self.psim_config_overrides["truth.leader.attitude.w"] = lin.Vector3([0.01,0.0711,-0.01]) | ||
self.initial_state = "standby" | ||
self.skip_deployment_wait = True | ||
|
||
def run(self): | ||
if not self.is_interactive: | ||
if not self.flight_controller.smart_read("attitude_estimator.valid"): | ||
raise TestCaseFailure("Attitude estimator failed to initialize.") | ||
|
||
self.finish() | ||
return | ||
|
||
log_fc_data(self.flight_controller) | ||
log_psim_data(self, "leader") | ||
|
||
self.cycle() | ||
|
||
|
||
class DualSatStandbyCase(DualSatCase, PSimCase): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(DualSatStandbyCase, self).__init__(*args, **kwargs) | ||
|
||
self.psim_configs += ["truth/standby"] | ||
self.psim_config_overrides["truth.leader.attitude.w"] = lin.Vector3([0.01,0.0711,-0.01]) | ||
self.psim_config_overrides["truth.follower.attitude.w"] = lin.Vector3([0.01,0.0711,-0.01]) | ||
self.leader_initial_state = "standby" | ||
self.follower_initial_state = "standby" | ||
self.leader_skip_deployment_wait = True | ||
self.follower_skip_deployment_wait = True | ||
|
||
def run(self): | ||
if not self.is_interactive: | ||
if not self.flight_controller_leader.smart_read("attitude_estimator.valid"): | ||
raise TestCaseFailure("Leader attitude estimator failed to initialize.") | ||
if not self.flight_controller_follower.smart_read("attitude_estimator.valid"): | ||
raise TestCaseFailure("Follower attitude estimator failed to initialize.") | ||
|
||
self.finish() | ||
return | ||
|
||
log_fc_data(self.flight_controller_leader) | ||
log_fc_data(self.flight_controller_follower) | ||
log_psim_data(self, "leader", "follower") | ||
|
||
self.cycle() |
This file contains 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from ..base import DualSatCase, SingleSatCase, PSimCase | ||
from .utils import log_fc_data, log_psim_data | ||
|
||
|
||
class SingleSatStartupCase(SingleSatCase, PSimCase): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(SingleSatStartupCase, self).__init__(*args, **kwargs) | ||
|
||
self.psim_configs += ["truth/deployment"] | ||
self.initial_state = "startup" | ||
|
||
def run(self): | ||
if not self.is_interactive: | ||
self.finish() | ||
return | ||
|
||
log_fc_data(self.flight_controller) | ||
log_psim_data(self, "leader") | ||
|
||
self.cycle() | ||
|
||
|
||
class DualSatStartupCase(DualSatCase, PSimCase): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(DualSatStartupCase, self).__init__(*args, **kwargs) | ||
|
||
self.psim_configs += ["truth/deployment"] | ||
self.leader_initial_state = "startup" | ||
self.follower_initial_state = "startup" | ||
|
||
def run(self): | ||
if not self.is_interactive: | ||
self.finish() | ||
return | ||
|
||
log_fc_data(self.flight_controller_leader) | ||
log_fc_data(self.flight_controller_follower) | ||
log_psim_data(self, "leader", "follower") | ||
|
||
self.cycle() |
This file contains 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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
"""Utility functions specific to full mission cases. | ||
Full mission cases here refers to those intended to be used for mission | ||
rehearsals. | ||
""" | ||
|
||
fc_fields = [ | ||
# Core state information | ||
"pan.state", | ||
"pan.bootcount", | ||
"pan.cycle_no", | ||
"pan.deployment.elapsed", | ||
# Other state machine states | ||
"adcs.state", | ||
"piksi.state", | ||
"radio.state", | ||
# Estimator information | ||
"time.valid", | ||
"time.gps", | ||
"orbit.valid", | ||
"orbit.pos", | ||
"orbit.vel", | ||
"rel_orbit.state", | ||
"rel_orbit.rel_pos", | ||
"rel_orbit.rel_vel", | ||
"attitude_estimator.valid", | ||
"attitude_estimator.q_body_eci", | ||
"attitude_estimator.L_body", | ||
"attitude_estimator.w_bias_body", | ||
# Attitude control commands | ||
"adcs_cmd.mtr_cmd", | ||
"adcs_cmd.rwa_torque_cmd", | ||
# PSim sensor debugging information | ||
# "piksi.time" | ||
# "adcs_monitor.ssa_vec", | ||
# "adcs_monitor.mag1_vec", | ||
# "adcs_monitor.gyr_vec", | ||
# "adcs_monitor.ssa_mode", | ||
] | ||
|
||
psim_fields_per_satellite = [ | ||
"truth.{}.attitude.w", | ||
"truth.{}.attitude.L", | ||
"truth.{}.wheels.t", | ||
"truth.{}.wheels.w", | ||
"truth.{}.orbit.r.ecef", | ||
"truth.{}.orbit.v.ecef", | ||
"sensors.{}.gyroscope.w.bias" | ||
] | ||
|
||
psim_fields = [ | ||
"truth.t.ns", | ||
"truth.dt.ns" | ||
] | ||
|
||
|
||
def log_fc_data(fc): | ||
for field in fc_fields: | ||
fc.smart_read(field) | ||
|
||
|
||
def log_psim_data(case, *satellites): | ||
"""Logs a collection of PSim associated with a testcase for the satellite(s) | ||
specified. | ||
""" | ||
for satellite in satellites: | ||
for field in psim_fields_per_satellite: | ||
case.rs_psim(field.format(satellite)) | ||
|
||
for field in psim_fields: | ||
case.rs_psim(field) |