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

Mission Cases for Telemetry Testing and Rehearsals #723

Merged
merged 6 commits into from
Apr 17, 2021
Merged
Show file tree
Hide file tree
Changes from 5 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
11 changes: 7 additions & 4 deletions .github/workflows/hootl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,14 @@ jobs:
!(python -m ptest runsim -c ptest/configs/hootl_speedup.json -t FailingEmptyCase -ni)
!(python -m ptest runsim -c ptest/configs/hootl_speedup.json -t FailingEmptySimCase -ni)

- name: Boot Utility Cases
- name: Mission Rehearsal Cases
run: |
python -m ptest runsim -c ptest/configs/hootl.json -t BootToStartupCase -ni
python -m ptest runsim -c ptest/configs/hootl.json -t BootToDetumbleCase -ni
python -m ptest runsim -c ptest/configs/hootl.json -t BootToStandbyCase -ni
python -m ptest runsim -c ptest/configs/hootl.json -t SingleSatStartupCase -ni
python -m ptest runsim -c ptest/configs/hootl_hootl.json -t DualSatStartupCase -ni
python -m ptest runsim -c ptest/configs/hootl.json -t SingleSatDetumbleCase -ni
python -m ptest runsim -c ptest/configs/hootl_hootl.json -t DualSatDetumbleCase -ni
python -m ptest runsim -c ptest/configs/hootl.json -t SingleSatStandbyCase -ni
python -m ptest runsim -c ptest/configs/hootl_hootl.json -t DualSatStandbyCase -ni

- name: Hardware Checkout Cases
run: |
Expand Down
17 changes: 10 additions & 7 deletions ptest/cases/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@
# - tools/alltest.sh
# - .github/workflows/hootl.yml

# Testcases that require simulation
from .empty_case import EmptySimCase, FailingEmptySimCase
from .dual_empty_case import DualEmptySimCase
from .piksi_fault_handler import PiksiFaultHandler
from .autonomous_mission_manager_pure_radio import AutonomousMissionController

# from .base import *
# Testcases intended for use with mission rehearsals and general telemetry
# testing.
from .mission import (
SingleSatStartupCase,
DualSatStartupCase,
SingleSatDetumbleCase,
DualSatDetumbleCase,
SingleSatStandbyCase,
DualSatStandbyCase
)

from .psim_debug import PSimDebug
from .dual_psim import DualPSim

# Testcases that don't require simulation
from .boot_to import BootToStartupCase, BootToDetumbleCase, BootToStandbyCase
from .empty_case import EmptyCase, FailingEmptyCase
from .dual_empty_case import DualEmptyCase
from .ditl_case import DitlCase
Expand Down
53 changes: 0 additions & 53 deletions ptest/cases/boot_to.py

This file was deleted.

79 changes: 0 additions & 79 deletions ptest/cases/dual_psim.py

This file was deleted.

3 changes: 3 additions & 0 deletions ptest/cases/mission/__init__.py
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
45 changes: 45 additions & 0 deletions ptest/cases/mission/detumble.py
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):
self.cycle()

if not self.is_interactive:
self.finish()
return

log_fc_data(self.flight_controller)
log_psim_data(self, "leader")


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):
self.cycle()

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")
59 changes: 59 additions & 0 deletions ptest/cases/mission/standby.py
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):
self.cycle()

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")


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):
self.cycle()

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")
42 changes: 42 additions & 0 deletions ptest/cases/mission/startup.py
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):
self.cycle()

if not self.is_interactive:
self.finish()
return

log_fc_data(self.flight_controller)
log_psim_data(self, "leader")


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):
self.cycle()

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")
Loading