How beagleboard/librobotcontrol works
Project Context and Scope
• Remember that the core library is the set of C API functions and low‐level hardware control routines that enable robot control on embedded systems (like the Robotics Cape and BeagleBone Blue).
• We’re focusing solely on the library-related components (the “library” folder) from branch v1.1 – disregarding examples, firmware, services, and other peripheral elements.
And Isolate the Main Components
For the core library, extract these components from the file tree’s “library” directory:
a. API / Public Interface:
– The header files under library/include/rc and its subdirectories.
– They define the API for the various modules and provide the contracts for client code.
b. Hardware Interface Modules:
– Locate the low-level I/O routines in library/src/io (ADC, GPIO, I2C, SPI, UART, PWM).
– These modules abstract communication with the hardware peripherals.
c. Mathematical and Control Algorithms:
– Under library/src/math, include modules such as algebra, filter, kalman, matrix, polynomial, and vector operations.
– This set supports the discrete time feedback control and numerical operations necessary for robot control.
d. Sensor and Actuator Integration:
– Components handling sensor data such as the MPU integration (library/src/mpu) and motor, encoder, and servo controls (library/src/motor, library/src/encoder, etc.).
e. Communication and Protocol Layer:
– MAVLink support is evident from both header and source files in the “library/include/rc/mavlink” folder and its corresponding implementations.
f. General Utilities and Core Services:
– Common functionalities such as CPU timing, thread management (pthread), start/stop routines, and version control (library/src/time, library/src/start_stop, etc.).
Depicting Component Relationships & Data Flow
– Show the API/Public Interface at the top or center. This is the entry point for external calls.
– Illustrate data or control flow between the math processing components and sensor modules since sensor data is processed and then passed into control routines.
– Indicate that the communication layer (MAVLink) interfaces both with the API and directly with hardware/sensor modules for telemetry and control commands.
Architectural Patterns
– Emphasize the layered architecture:
• Top Layer: API / Public Interface (header files that define the library contracts).
• Middle Layer: Implementation modules that handle hardware I/O and mathematical processing.
• Lower Layer: Hardware interaction or communication drivers.