How safehold17/ros_motion_planning works
Main Components
• Core Motion Planning Modules:
– Common Utilities and Infrastructure (geometry, math helpers, logging, etc.)
– Path Planners (global planning algorithms such as A*, JPS, D*, RRT, etc. found under src/core/path_planner)
– Controllers (local planners such as PID, LQR, DWA, APF, RPP, MPC; see src/core/controller)
– Curve Generation Components (Bezier, BSpline, Dubins, Reeds-Shepp, etc.)
• Simulation Environment:
– ROS simulation setup (src/sim_env with its config, launch, maps, models, URDF, and worlds directories)
– Robot and environment models, including URDFs and meshes for Turtlebot3 and nanocar.
• Plugins:
– RViz and dynamic configuration plugins (both dynamic_rviz_config and dynamic_xml_config)
– Gazebo plugins (e.g., pedestrian_sfm_plugin and pedestrian_visualizer_plugin)
– Map plugins (e.g., voronoi_layer) and other custom visualization tools.
• User and Build Infrastructure:
– Scripts (build.sh, main.sh, killpro.sh) for compilation, launching, and termination.
– Docker and third-party repository integration (docker folder, 3rd directory with Conan build files)
– User configuration files (src/user_config) for setting up parameters that drive the generation of launch files.
• Documentation and DevTools:
– Integration with doxygen (via Doxyfile) for generating API and interface documentation.
– Versioning and historical documentation (docs folder).
Relationships and Flows
• Data Flow:
– Users modify configuration files (in “user_config”) that dynamically generate ROS launch files (notably under sim_env/launch) for running the simulation along with the planning and control nodes.
– The “Core Motion Planning” components process sensor inputs (from ROS topics) and output planned paths and trajectory commands back into the ROS ecosystem.
• Interactions:
– Core modules (controllers, planners, curve generators) are independent but interact via common message formats (e.g., through ROS msg definitions found in plugins) and shared utility libraries.
– Plugins serve as adapters/connectors between underlying planning algorithms and visualization interfaces (RViz and Gazebo), thus extending the user’s ability to dynamically adjust parameters.
• Build & Deployment:
– The build scripts and Conan configurations in “3rd” ensure the proper setup of dependencies.
– Docker containers (in the docker folder) encapsulate the ROS Noetic environment required to run the application seamlessly.
Architectural Patterns and Design Principles
• Modular Design: Each major component (core planners, controllers, simulation, plugins) is neatly compartmentalized into separate directories. This encourages reusability and independent evolution.
• ROS Node Architecture: Visualization and simulation are running as ROS nodes, with clear publisher/subscriber relationships, parameter servers (via configuration files) and dynamic reconfiguration (via plugins).
• Plugin/Extension Based Architecture: The plugins directory shows a clear approach to extending and customizing the system (e.g., for RViz or Gazebo), making the system adaptable to different robotics applications.
• Configuration Driven: The use of “user_config” files and auto-generation of launch files illustrates a design that favors configuration over hard-coded parameters.