How gkd-rm-lab/gkd_control works
• Third‐Party Libraries:
– Show the 3rdparty “serial” library components (both headers and source). Indicate that these modules are responsible for serial communication and provide platform abstraction (Unix/Windows).
• Hardware Interface Layer:
– Include components like “hardware” (e.g., can.cc, dji_motor.cc) and “device” modules (IMU, referee protocols, UI, RC controller, etc.). These represent the interfaces to the underlying physical devices.
• Control and Logic Layer:
– Represent the control modules such as “control” (controller.cc, pid_controller.cc, ramp.cc), “robot_controller”, and support logic (user_lib) that steer the robotic actions.
• Subsystem Modules:
– Gimbal: Include the gimbal control logic (src/gimbal) and related configuration files.
– Shooting: Represent the shooting subsystem (src/shoot) that contains bullet solving algorithms and shooting configurations.
• I/O and Communication Layer:
– Illustrate the I/O modules (src/io) such as serial_interface.cc and socket_interface.cc that handle data input and output – this ensures various external connections.
• Build & Deployment/Entry Point:
– Highlight the main entry point (src/main.cc) that integrates and starts the control loop, and emphasize the build configurations (Makefile and CMakeLists.txt) which are part of the “deployment pipeline”.
Relationships and Data Flow
– From the main() entry point to the robot controller.
– From the robot controller to individual subsystems (chassis, gimbal, shoot) and to I/O modules.
– Between the hardware modules and the device interfaces.
– Between control algorithms and I/O interfaces (to send commands and receive sensor data).
Architectural Patterns and Design Principles
• Modular Layering: Show how responsibilities are separated into hardware abstraction, control logic, and communication interfaces.
• Clear Separation of Concerns: Ensure that modules like device communication, control algorithms, and hardware drivers are clearly distinguished.
• Integration of Third-Party Code: Illustrate that the serial communication library (3rdparty) is integrated into the I/O layer.
• Platform-Dependent Implementation: Note that certain parts of the serial library handle Unix vs. Windows specifics.