StrathSEDS-on-GitHub / firefly-firmware

Firmware for StrathSEDS' entry to Mach-23
Mozilla Public License 2.0
3 stars 0 forks source link

Configuration for staging #1

Open m1-ins opened 11 months ago

m1-ins commented 11 months ago

There is currently no way of altering the values easily for staging, and as such a config file would be great to assist in testing and for future-proofing.

danielstebbings commented 11 months ago

Hey besties: Some requirements for what we're going to need configwise, this may change later!

As Kyle has been intending: Each stage has sensors it will check / actions to undertake. Each stage has a primary and backup transition condition, like altitude limits, velocity limits etc.

Each stage should have the following options to configure:

The radio settings should be set once, and should not change with stages.

X-yl commented 11 months ago

Sample staging config:

staging: [
    {
        stage: "pad"
        consensus: 2
        actions: []
        triggers: [
            "pressure > 10m",
            "breakwire = broken"
            "accel > 3m/s2"
        ],
        pressure_config: {
            poll_rate: 40
            tx_decimation: 3
            save_decimation: 1
        }
        // also gps and imu config..
        transmission_profile: {
            // Radios share a 500ms slot in a 1:5:1 ratio for ids 1,2,3.
            max_latency: "500ms"
            config: {
                "1": 1
                "2": 5
                "3": 1
            }
        }
    },
    {
        stage: "ascent",
        consensus: 1
        triggers: [
            "velocity < -1m/s"
            "stage_time > 10s"
        ]
        // .. other keys omitted for brevity
    },
    {
        stage: "drogue_deploy"
        consensus: 1
        actions: [
            "pyro1_fire"
        ]
        triggers: [
            "altitude < 300m",
            "stage_time > 10s and velocity > 20m/s"
        ]
        // .. other keys omitted for brevity
    },
    {
        stage: "main_deploy",
        actions: [
            "pyro2_fire"
        ]
    },
    {
        stage: "landed",
        actions: [
            "buzzer_activate"
        ]
        // .. other keys omitted for brevity
    }
]