How chanjoon/mpcc works
• ROS Interface & Launch System:
• The “launch” directory contains several launch files (e.g., quadrotor_gazebo.launch, test_circle.launch, test_lemniscate.launch) that initialize the simulation environment and control processes.
• You may include key ROS-related components like the ROS nodes and topics for state estimation, control commands, and trajectory information.
• MPC Controller Core:
• The “include/mpcc” and “src” directories contain the MPCC core implementation (e.g., mpcc_wrapper.cpp, mpcc_test.cpp, astar.cpp).
• Workflow from state input to cost function evaluation, where the MPC uses the quadrotor dynamic model (found in “model/quadrotor_model_thrustrates.cpp”) and computes optimal control actions.
• Quadrotor Dynamic Model & Cost Function:
• The “model” directory contains various files including the quadrotor model, ACADO interface files, and code generation scripts.
• QP Solver Integration:
• The “qp_solver/qpoases” directory houses the qpOASES implementation that is invoked to solve the quadratic program defined by the controller.
• QpOASES as a component that takes the formulated quadratic cost and constraint matrices (from ACADO) and returns the computed control inputs.
• Utility Libraries & Configuration:
• The “include/utils” directory is used for auxiliary functions (e.g., grid map, raycast, wind disturbance) that support the control and simulation.
• That parameter files (found in “config” and “parameters” directories) and scripts (in “scripts”) provide supporting configurations and testing aids.
• Simulation Environment:
• Integrate external simulation and hardware-in-the-loop components including PX4 and Gazebo (as referenced by the launch files).
Important architectural patterns and design principles
• Modularity: Separate components for the ROS interface, the core predictive control algorithm, the dynamic model, and the QP solver.
• Layered architecture: Distinguish between higher-level simulation and visualization (PX4, Gazebo) and lower-level, real-time control algorithms (ACADO interfacing and QP solving).
• Integration: Pay special attention to how the ACADO-generated code (embedded in “model/quadrotor_mpcc” and related files) is statically included in the repository, which means you do not need external ACADO dependencies for compiled code.
Following elements
• Clear labels for each component (e.g., “ROS Launch & Interface”, “Quadrotor Dynamic Model”, “MPC Controller (ACADO based)”, “QP Solver (qpOASES)”, “Utility & Config Files”).