Software Design Case Study ArduPilot Shashwat Ganesh (RA2111003011536) ArduPilot - World’s Most Advanced Autopilot - Open Source - Free to Use/Experiment/Change - Huge Community - Hardware Ecosystem - ~ 70k LOC - 600+ Contributors - Demo? Overview Commands A platform independent, vendor neutral command protocol: MAVLink Heavily tested, critical component Publish-Subscribe model for continuous data streams Point-Point model for mission parameters Programming Language independent: Several bindings available to send and receive messages Medium independent: Over Radio (900MHz, 2.4GHz, 5.8GHz, etc) or USB or Internet Used for control by a more powerful on-board computer or at the GCS Several choices for Ground Control Station (GCS) software, depending on mission needs. GCS GUI - Mission Planner GCS GUI - QGroundControl Vehicles ● ● ● All the relevant behaviour for a vehicle type: Copter, Rover, Boat, Submarine, Plane Various modes for each vehicle type, supporting different operational scenarios An infinite main loop, constantly updating the current position and acting according to the acceleration and velocity commands. Libraries AC_AttitudeControl AP_AdvancedFailsafe AP_CheckFirmware AP_FlashStorage AP_ICEngine AP_Math AP_OLC AP_RCProtocol AP_SmartRTL AP_WheelEncoder AC_Autorotation AP_AHRS AP_Common AP_Follow AP_InertialNav APM_Control AP_ONVIF AP_RCTelemetry AP_Soaring AP_Winch AC_AutoTune AP_Airspeed AP_Compass AP_Frsky_Telem AP_InertialSensor AP_Menu AP_OpenDroneID AP_Relay AP_Stats AP_WindVane AC_Avoidance AP_AIS AP_CSVReader AP_Generator AP_InternalError AP_Mission AP_OpticalFlow AP_RobotisServo AP_TECS AR_Motors AC_CustomControl AP_Arming AP_CustomRotations AP_GPS AP_IOMCU AP_Module AP_OSD AP_ROMFS AP_TempCalibration AR_WPNav AC_Fence AP_Avoidance AP_DAL AP_Gripper AP_IRLock AP_Motors AP_Parachute AP_RPM AP_TemperatureSensor doc AC_InputManager AP_Baro AP_Declination AP_GyroFFT AP_JSButton AP_Mount AP_Param AP_RSSI AP_Terrain Filter AC_PID AP_BattMonitor AP_Devo_Telem AP_HAL AP_KDECAN AP_MSP AP_PiccoloCAN AP_RTC AP_Torqeedo GCS_MAVLink AC_PrecLand AP_Beacon AP_EFI AP_HAL_ChibiOS AP_L1_Control AP_NavEKF AP_Proximity AP_SBusOut AP_Tuning PID AC_Sprayer AP_BLHeli AP_ESC_Telem AP_HAL_Empty AP_Landing AP_NavEKF2 AP_Radio AP_Scheduler AP_UAVCAN RC_Channel AC_WPNav AP_BoardConfig AP_ExternalAHRS AP_HAL_ESP32 AP_LandingGear AP_NavEKF3 AP_Rally AP_Scripting AP_Vehicle SITL AP_AccelCal AP_Button AP_FETtecOneWire AP_HAL_Linux AP_LeakDetector AP_Navigation AP_RAMTRON AP_SerialLED AP_VideoTX SRV_Channel AP_ADC AP_Camera AP_Filesystem AP_HAL_SITL AP_Logger AP_NMEA_Output AP_RangeFinder AP_SerialManager AP_VisualOdom StorageManager AP_ADSB AP_CANManager AP_FlashIface AP_Hott_Telem AP_LTM_Telem AP_Notify AP_RCMapper AP_ServoRelayEvents AP_Volz_Protocol ● 139 Libraries ● Common functionality for all Vehicle types ● Abstract away specifics of [file-handling, scheduling, radio communications…] ● Each type has atleast the common interface, additional functionality exposed via methods/functions ● Easy to debug, test and blame ● Used through aggregation and composition HAL Ardupilot supports a variety of Hardware Targets: Each having different sensors/peripherals/controllers Simulation and Testing ● Crashing drones in simulation is cheaper than crashing real ones ● Simulation of the vehicle and I/O states ● Useful for testing edge-case situations and failsafe mechanisms without damaging hardware ● Allows for 3rd Party Physics and Flight dynamics simulators ● Continuous Integration for every change ● Hardware Integration Testing