How ai-winter/ros_motion_planning works
Main Components
• Core Motion Planning Algorithms: This is the “heart” of the system where you have both global and local planning modules. In the file tree, these are primarily found under “src/core”:
– Global planners: Under “src/core/path_planner” (e.g., A*, Dijkstra, JPS, D*, LPA*, etc.). They define how paths are planned on grids or via sampling-based strategies.
– Local controllers: Under “src/core/controller” (with subdirectories for PID, DWA, APF, LQR, MPC, RPP etc.) which focus on trajectory tracking, dynamic window approach, and other control strategies.
– Common utilities and curve generation: Under “src/core/common” that contains foundational geometric utilities (e.g., Bezier, cubic splines, BSpline, Dubins, Reeds-Shepp curves) used in trajectory optimization.
• Simulation and Environment Modules: Under “src/sim_env” you find configuration files, launch scripts, maps, meshes, models, and URDF files. These components are used to simulate the robot’s operating environment (e.g., Gazebo worlds, RViz configurations).
• Plugins and Extensions: May include dynamic configuration for RViz, XML configuration generators, Gazebo plugins (e.g., for pedestrian simulation, costmap plugins), and RViz plugins (the “src/plugins” directory). These extend the primary functionality to visualization and real-world simulation integration.
• User Configuration: The “src/user_config” folder holds YAML files that drive runtime behavior (parameters for robots, planners, obstacles, and maps). This is critical because the launch files are auto-generated based on these configurations.
• Build and Deployment Tools: The “scripts” directory (with build.sh, main.sh, killpro.sh) provides the entry points for compiling and running the system. There are also Docker files and a 3rd-party dependency setup (via conan scripts) to support consistent deployment.
Clarifying Relationships and Data Flow
• Inter-module Interaction: Show the flow from cost maps and sensor data coming into simulation modules to the “core” algorithms that compute planned paths based on both global (graph-based planning, sampling methods) and local (dynamic control and obstacle avoidance) strategies.
• Configuration Flow: Illustrate how the user configuration files (and dynamically generated launch files) enable runtime parameterization. This links the “user_config” components to both the simulation environment and the core planner nodes.
Architectural Patterns and Design Principles
• Modular and Plugin-Based Design: The project is split into clear modules (planning, simulation, plugins) that interact via well-defined ROS interfaces.
• Separation of Concerns: Global vs. local planning is clearly segmented, as are environment simulation components and user interface/configuration components.
• Reusability and Extensibility: The multiple subdirectories for algorithms (each with its own package.xml and CMakeLists.txt) demonstrate that each planner or controller is a plug-and-play component. This separation allows for new planners/controllers to be added without disrupting the overall system.
• ROS Integration: Emphasize full ROS integration with nodes, topics, and services, along with launch file generation from configuration YAMLs.
Relevant Technologies and Libraries
• ROS Noetic on Ubuntu 20.04.
• C++ (with CMake build system) as the primary language for most core components.
• Conan for dependency management.
• Docker for environment consistency.
• Doxygen for documentation generation.
• GraphViz (likely used with Doxygen) for visualization of code architecture.
Detailed Elements
• Annotations indicating architectural patterns (e.g., “Plugin Architecture”, “Modular ROS Nodes”, “Configuration Driven Launch”).
• Reference to technology stacks (e.g., “C++/ROS Nodes”, “Python Scripts for Launch and Auto-generation”, “Dockerized Environment”).
Final Instruction: