How tranhoaiduong136/capstoneproject works
Project Type & Purpose
• This is a multi-agent path planner for robots constrained to move along grid edges. It integrates both motion planning and visualization using ROS.
• The important components include a motion planner node (that calculates the shortest, collision-free path) and an agent node (that handles the robot’s actual movement visualization and user-triggered goal updates).
File Structure
• Top-level files like CMakeLists.txt and package.xml indicate that this is a ROS package.
• The “src” directory contains C++ source files divided into two groups:
• motion_planner_node and its corresponding object files (source/object files for the planner’s functionality)
• agent_node and its object files (for agent representation and goal updates).
• The “srv” and “msg” directories show custom service definitions and messages (get_plan, update_goal, and agent_info), which facilitate inter-node communication via ROS services and topics.
• The “launch” directory contains launch files (agents.launch) to start and wire up the various nodes.
• The “rviz” directory holds configurations for the RViz display.
• The “media” directory, although not affecting architecture directly, contains videos that validate the system’s functioning.
• The “test” directories indicate that unit-testing is a part of the system, testing both the service calls (update_goal) and planning algorithm.
Key Components & Their Interactions
• Motion Planner Node:
• Responsible for computing the optimal path using A*.
• Publishes marker topics (grid nodes free/occupied) for grid visualization.
• Subscribes to feedback from agent nodes.
• Provides a service endpoint (/get_plan) for other nodes (i.e., agent nodes) to request a path.
• Files: motion_planner_node.cpp, motion_planner_obj.cpp/h.
• Agent Node:
• Responsible for receiving a goal pose via a ROS service call (/agent_x/update_goal).
• Acts as a service client calling /get_plan to receive the planned path.
• Publishes markers for both the base link of the robot and its planned path.
• Files: agent_node.cpp, agent_obj.cpp/h.
• ROS Communication:
• Service calls between agent nodes and the motion planner.
• Topics for publishing visualizations (e.g., grid nodes, agent base link, and path).
• Feedback channel through a common /agent_feedback topic.
Architectural Patterns & Design Principles
• Modular node design: Separates motion planning and agent actions into dedicated ROS nodes.
• Service-Oriented Architecture: Using ROS services (get_plan, update_goal) ensures decoupled communication between the motion planner and agents.
• Object-based implementation: Both nodes leverage object-oriented programming to encapsulate their functionality.
• Scalability: The design supports scaling (adding more agents by including additional agent nodes and corresponding markers) with minimal changes.
• Clear labels for each ROS node: Motion Planner Node and Agent Node(s).
• Service calls (/get_plan, /update_goal).
• Published topics: grid markers, path, agent feedback, etc.