How embedded-purdue/slayterhil works
SlayterHIL is a hardware-in-the-loop system for exercising drone flight software without a real flight. The documented path is simulation-generated sensor output, deterministic injection by the Test Node, and evaluation on the flight controller; the dashboard provides the user interface and a playback view of simulation output. Internally, the simulator combines drone dynamics, control, and IMU generation. The README supports the HIL and playback relationships, but sampled source does not establish dashboard-to-test orchestration or the complete Test Node transfer path, so those links are omitted.
Main entry points: main.cpp Simulation runner · src/main.c Test Node bridge · src/main.c Controller entry · bno.c Sensor readers
Components 20
Test dashboard
- Dashboard UI
app/dashboard/script.js - Dashboard server
app/dashboard/server.py - Sim output view
app/dashboard/script.js
Flight simulation
- Simulation runner
flight_sim/src/main.cpp - Drone dynamics
flight_sim/src/rigid_body.cpp - Position control
flight_sim/src/positionController.cpp - Velocity control
flight_sim/src/velocityController.cpp - IMU generation
flight_sim/src/imu_generation.cpp - Simulation output files
flight_sim/src/main.cpp
HIL bridge
- Test Node bridge
test_node/app/src/main.c - Sensor injection
test_node/app/src/threads/c/sensor_emulation.c - SPI bit-bang driver
test_node/modules/spis_bitbang/drivers/spis_bitbang/spis_bitbang.c
Flight controller
- Controller entry
flight_controller/app/src/main.c - Flight state machine
flight_controller/app/src/state_machine.c - Sensor readers
flight_controller/app/src/bno.c - Flight control and PID
flight_controller/app/src/control.c - BNO055 driver
flight_controller/drivers/sensor/bno055/bno055.c
Sensor transport
- Sensor packet schema
shared/proto/sensor_data.proto - SPI transport
SPI_Slave_Driver/SpiTransport.cpp
Other components
- Test user
Connections 17
- Test user → Dashboard UI: uses
README.md - Dashboard server → Dashboard UI: serves
README.md - Simulation runner → Simulation output files: writes
README.md - Simulation output files → Sim output view: plays back
README.md - Simulation runner → Test Node bridge: provides sensor outputs
README.md - Test Node bridge → Sensor injection: runs injection
- Test Node bridge → Controller entry: injects sensors
README.md - Simulation runner → Drone dynamics: updates
- Simulation runner → Position control: uses
- Simulation runner → Velocity control: uses
flight_sim/src/main.cpp - Simulation runner → IMU generation: generates IMU
flight_sim/src/main.cpp - Controller entry → Sensor readers: starts threads
flight_controller/app/src/main.c - Controller entry → Flight control and PID: includes control
flight_controller/app/src/main.c - Controller entry → Flight state machine: includes interface
flight_controller/app/src/main.c - Sensor readers → BNO055 driver: reads sensor
- Simulation runner → Sensor packet schema: uses packet format
- Test Node bridge → SPI transport: transfers over SPI