Skip to content

Commit

Permalink
add oresat1 configs
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpdx committed Oct 14, 2023
1 parent 392736e commit 4512268
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 2 deletions.
3 changes: 3 additions & 0 deletions oresat_od_db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
from .constants import NODE_NICE_NAMES, ORESAT_NICE_NAMES, NodeId, OreSatId, __version__
from .oresat0 import ORESAT0_BEACON_DEF, ORESAT0_OD_DB
from .oresat0_5 import ORESAT0_5_BEACON_DEF, ORESAT0_5_OD_DB
from .oresat1 import ORESAT1_BEACON_DEF, ORESAT1_OD_DB

OD_DB = {
OreSatId.ORESAT0: ORESAT0_OD_DB,
OreSatId.ORESAT0_5: ORESAT0_5_OD_DB,
OreSatId.ORESAT1: ORESAT1_OD_DB,
}

BEACON_DEF_DB = {
OreSatId.ORESAT0: ORESAT0_BEACON_DEF,
OreSatId.ORESAT0_5: ORESAT0_5_BEACON_DEF,
OreSatId.ORESAT1: ORESAT1_BEACON_DEF,
}
79 changes: 79 additions & 0 deletions oresat_od_db/oresat1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
"""OreSat1 object dictionary and beacon globals."""

import os

import yaml

from .. import NodeId, OreSatId
from .._yaml_to_od import gen_od_db, read_yaml_od_config
from ..base import (
BAT_CONFIG,
C3_CONFIG,
CFC_CONFIG,
DXWIFI_CONFIG,
FW_COMMON_CONFIG,
GPS_CONFIG,
IMU_CONFIG,
RW_CONFIG,
SOLAR_CONFIG,
ST_CONFIG,
SW_COMMON_CONFIG,
)

_CONFIGS_DIR = f"{os.path.dirname(os.path.abspath(__file__))}/configs"
C3_CONFIG_OVERLAY = read_yaml_od_config(f"{_CONFIGS_DIR}/c3_overlay.yaml")

with open(f"{_CONFIGS_DIR}/beacon.yaml", "r") as f:
ORESAT1_BEACON_DEF = yaml.safe_load(f)


ORESAT1_OD_DB = gen_od_db(
OreSatId.ORESAT1,
ORESAT1_BEACON_DEF,
{
NodeId.C3: (C3_CONFIG, SW_COMMON_CONFIG, C3_CONFIG_OVERLAY),
NodeId.BATTERY_1: (BAT_CONFIG, FW_COMMON_CONFIG),
NodeId.BATTERY_2: (BAT_CONFIG, FW_COMMON_CONFIG),
NodeId.SOLAR_MODULE_1: (SOLAR_CONFIG, FW_COMMON_CONFIG),
NodeId.SOLAR_MODULE_2: (SOLAR_CONFIG, FW_COMMON_CONFIG),
NodeId.SOLAR_MODULE_3: (SOLAR_CONFIG, FW_COMMON_CONFIG),
NodeId.SOLAR_MODULE_4: (SOLAR_CONFIG, FW_COMMON_CONFIG),
NodeId.SOLAR_MODULE_5: (SOLAR_CONFIG, FW_COMMON_CONFIG),
NodeId.SOLAR_MODULE_6: (SOLAR_CONFIG, FW_COMMON_CONFIG),
NodeId.SOLAR_MODULE_7: (SOLAR_CONFIG, FW_COMMON_CONFIG),
NodeId.SOLAR_MODULE_8: (SOLAR_CONFIG, FW_COMMON_CONFIG),
NodeId.IMU: (IMU_CONFIG, FW_COMMON_CONFIG),
NodeId.REACTION_WHEEL_1: (RW_CONFIG, FW_COMMON_CONFIG),
NodeId.REACTION_WHEEL_2: (RW_CONFIG, FW_COMMON_CONFIG),
NodeId.REACTION_WHEEL_3: (RW_CONFIG, FW_COMMON_CONFIG),
NodeId.REACTION_WHEEL_4: (RW_CONFIG, FW_COMMON_CONFIG),
NodeId.GPS: (GPS_CONFIG, SW_COMMON_CONFIG),
NodeId.STAR_TRACKER_1: (ST_CONFIG, SW_COMMON_CONFIG),
NodeId.STAR_TRACKER_2: (ST_CONFIG, SW_COMMON_CONFIG),
NodeId.DXWIFI: (DXWIFI_CONFIG, SW_COMMON_CONFIG),
NodeId.CFC: (CFC_CONFIG, SW_COMMON_CONFIG),
},
)

# direct access to ODs
ORESAT1_C3_OD = ORESAT1_OD_DB[NodeId.C3]
ORESAT1_BATTERY_1_OD = ORESAT1_OD_DB[NodeId.BATTERY_1]
ORESAT1_BATTERY_2_OD = ORESAT1_OD_DB[NodeId.BATTERY_2]
ORESAT1_SOLAR_MODULE_1_OD = ORESAT1_OD_DB[NodeId.SOLAR_MODULE_1]
ORESAT1_SOLAR_MODULE_2_OD = ORESAT1_OD_DB[NodeId.SOLAR_MODULE_2]
ORESAT1_SOLAR_MODULE_3_OD = ORESAT1_OD_DB[NodeId.SOLAR_MODULE_3]
ORESAT1_SOLAR_MODULE_4_OD = ORESAT1_OD_DB[NodeId.SOLAR_MODULE_4]
ORESAT1_SOLAR_MODULE_5_OD = ORESAT1_OD_DB[NodeId.SOLAR_MODULE_5]
ORESAT1_SOLAR_MODULE_6_OD = ORESAT1_OD_DB[NodeId.SOLAR_MODULE_6]
ORESAT1_SOLAR_MODULE_7_OD = ORESAT1_OD_DB[NodeId.SOLAR_MODULE_7]
ORESAT1_SOLAR_MODULE_8_OD = ORESAT1_OD_DB[NodeId.SOLAR_MODULE_8]
ORESAT1_IMU_OD = ORESAT1_OD_DB[NodeId.IMU]
ORESAT1_REACTION_WHEEL_1_OD = ORESAT1_OD_DB[NodeId.REACTION_WHEEL_1]
ORESAT1_REACTION_WHEEL_2_OD = ORESAT1_OD_DB[NodeId.REACTION_WHEEL_2]
ORESAT1_REACTION_WHEEL_3_OD = ORESAT1_OD_DB[NodeId.REACTION_WHEEL_3]
ORESAT1_REACTION_WHEEL_4_OD = ORESAT1_OD_DB[NodeId.REACTION_WHEEL_4]
ORESAT1_GPS_OD = ORESAT1_OD_DB[NodeId.GPS]
ORESAT1_STAR_TRACKER_1_OD = ORESAT1_OD_DB[NodeId.STAR_TRACKER_1]
ORESAT1_STAR_TRACKER_2_OD = ORESAT1_OD_DB[NodeId.STAR_TRACKER_2]
ORESAT1_DXWIFI_OD = ORESAT1_OD_DB[NodeId.DXWIFI]
ORESAT1_CFC_OD = ORESAT1_OD_DB[NodeId.CFC]
5 changes: 5 additions & 0 deletions oresat_od_db/oresat1/configs/beacon.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
revision: 0
fields:
- [beacon, start_chars]
- [satellite_id]
- [beacon, revision]
3 changes: 3 additions & 0 deletions oresat_od_db/oresat1/configs/c3_overlay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
objects:
- name: flight_mode
access_type: ro
5 changes: 5 additions & 0 deletions scripts/gen_canopennode_od.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,11 @@ def write_canopennode_h(od: canopen.ObjectDictionary, dir_path: str = "."):
("oresat0.5", "solar"): OD_DB[OreSatId.ORESAT0_5][NodeId.SOLAR_MODULE_1],
("oresat0.5", "imu"): OD_DB[OreSatId.ORESAT0_5][NodeId.IMU],
("oresat0.5", "reaction_wheel"): OD_DB[OreSatId.ORESAT0_5][NodeId.REACTION_WHEEL_1],
# OreSat1
("oresat1", "battery"): OD_DB[OreSatId.ORESAT1][NodeId.BATTERY_1],
("oresat1", "solar"): OD_DB[OreSatId.ORESAT1][NodeId.SOLAR_MODULE_1],
("oresat1", "imu"): OD_DB[OreSatId.ORESAT1][NodeId.IMU],
("oresat1", "reaction_wheel"): OD_DB[OreSatId.ORESAT1][NodeId.REACTION_WHEEL_1],
}


Expand Down
6 changes: 5 additions & 1 deletion scripts/gen_dcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ def main():
"""The main"""

parser = ArgumentParser()
parser.add_argument("oresat", default="oresat0", help="oresat mission; oresat0 or oresat0.5")
parser.add_argument(
"oresat", default="oresat0", help="oresat mission; oresat0, oresat0.5, or oresat1"
)
parser.add_argument("card", help="card name; all, c3, gps, star_tracker_1, etc")
parser.add_argument("-d", "--dir-path", default=".", help='directory path; defautl "."')
args = parser.parse_args()
Expand All @@ -235,6 +237,8 @@ def main():
od_db = OD_DB[OreSatId.ORESAT0]
elif args.oresat == "oresat0.5":
od_db = OD_DB[OreSatId.ORESAT0_5]
elif args.oresat == "oresat1":
od_db = OD_DB[OreSatId.ORESAT1]
else:
print(f"invalid oresat mission {args.oresat}")
sys.exit()
Expand Down
2 changes: 2 additions & 0 deletions scripts/print_od.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def main():
od_db = OD_DB[OreSatId.ORESAT0]
elif args.oresat == "oresat0.5":
od_db = OD_DB[OreSatId.ORESAT0_5]
elif args.oresat == "oresat1":
od_db = OD_DB[OreSatId.ORESAT1]
else:
print(f"invalid oresat mission {args.oresat}")
sys.exit()
Expand Down
2 changes: 1 addition & 1 deletion scripts/sdo_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def main():
"--oresat",
metavar="ORESAT",
default="oresat0.5",
help="oresat# (e.g.: oresat0, oresat0.5)",
help="oresat# (e.g.: oresat0, oresat0.5, oresat1)",
)
args = parser.parse_args()

Expand Down

0 comments on commit 4512268

Please sign in to comment.