How gloriaprojeto/gloria_orthosis works
This is embedded firmware for a sensor-driven orthosis: setup initializes the joints and sensors, calibrates the accelerometer, and starts configuration; the loop uses movement and load readings to transition between idle, food-reaching, and eating actions. Controllers coordinate sensor, model, and serial-view responsibilities, while the joint controller moves three servos. The configuration controller also exposes Wi-Fi setup and MQTT connection capabilities. Source excerpts show the main loop and accelerometer controller; some subsystem links are therefore marked unverified.
Main entry points: main.cpp Loop and state flow · AccelerometerController.cpp Accelerometer controller · LoadCellController.cpp Load-cell controller · ConfigController.cpp Configuration controller
Components 15
Firmware runtime
- Loop and state flow
src/main.cpp - Orthosis states
src/model/OrthosisStates.h
Sensing and feedback
- Accelerometer controller
src/controller/AccelerometerController.cpp - Accelerometer sensor
src/sensor/AccelerometerSensor.cpp - Accelerometer model
src/model/AccelerometerModel.cpp - Load-cell controller
src/controller/LoadCellController.cpp - Load-cell sensor
src/sensor/LoadCellSensor.cpp - Load-cell model
src/model/LoadCellModel.cpp - Serial view
src/view/SerialView.cpp
Joint motion
- Joint motion controller
src/controller/JointsController.cpp - Servo joint
src/model/Joint.cpp
Connectivity and configuration
- Configuration controller
src/controller/ConfigController.cpp - Wi-Fi configuration
src/model/ConfigModel.h
Other components
- Wi-Fi network
- MQTT service
Connections 15
- Loop and state flow → Orthosis states: tracks transitions
src/main.cpp - Loop and state flow → Accelerometer controller: reads movement
src/main.cpp - Loop and state flow → Load-cell controller: reads weight
src/main.cpp - Loop and state flow → Joint motion controller: commands poses
src/main.cpp - Loop and state flow → Configuration controller: starts connection
src/main.cpp - Accelerometer controller → Accelerometer sensor: reads and calibrates
src/controller/AccelerometerController.cpp - Accelerometer controller → Accelerometer model: updates readings
src/controller/AccelerometerController.cpp - Accelerometer controller → Serial view: reports readings
src/controller/AccelerometerController.cpp - Load-cell controller → Load-cell sensor: uses sensor
- Load-cell controller → Load-cell model: uses model
- Load-cell controller → Serial view: reports weight
- Joint motion controller → Servo joint: moves joints
src/controller/JointsController.cpp - Configuration controller → Wi-Fi configuration: uses settings
src/controller/ConfigController.cpp - Configuration controller → Wi-Fi network: connects network
- Configuration controller → MQTT service: connects broker