MissouriMRR / SUAS-2025

Missouri S&T Multirotor Design Team's code for the 2025 Student Unmanned Aerial Systems Competition (SUAS).
MIT License
3 stars 0 forks source link

Add Mission Config File #5

Open RexBerry opened 1 month ago

RexBerry commented 1 month ago

Add Mission Config File

Problem

Multiple locations in the code have to be changed to configure the mission settings and sim mode flag, with some tests requiring command-line arguments.

Solution

Add a mission_config.json file with mission settings and change the code to use it.

Code could be changed to use the state_machine.FlightSettings class, which could be modified to read from the config file. A method such as FlightSettings.get_from_config() could return a FlightSettings object, with the object being cached after being created for the first time. Additionally, this method could use command-line arguments (read using argparse) to allow the user to choose a different config file and override specific settings (for example, a -s option to set the sim flag).

Example mission_config.json:

{
    "waypointData": "flight/data/waypoint_data.json",
    "simFlag": true,
    "skipWaypoint": false,
    "standardObjectCount": 5
}

The config file could also contain other constants, such as the waypoint tolerance. Make sure the units (e.g., meters) are clearly documented.

Additional Information

Search the repo for waypoint_data.json, golf_data.json, sim_flag, and --sim to find most of the code that needs to be changed.