๐ System Integration
How does all your code, hardware, and ROS2 nodes actually work together?
This page shows how your custom logic, third-party packages, and real hardware connect in a single ROS2 ecosystem.
๐งฉ How Your Code Fits into ROS2โ
Your project is a classic ROS2 modular system:
- Each function (detection, navigation, manipulation, state management) is a separate node.
- Nodes interact via topics, services, and actions.
- The mission manager node acts as the โbrain,โ coordinating everything and handling real-time events.
Tip
โThink of every major box in your system as a separate node. Each node is replaceable, debuggable, and testable on its own.โ
๐บ๏ธ System Integration Diagramโ
๐ Communication Patternsโ
| Pattern | Example in Your Project |
|---|---|
| Topic | /target_pose from Detector โ Mission Manager |
| Action | Navigation goals via nav2_msgs/action/NavigateToPose |
| Service | (Optional) Reset, trigger, parameter tuning |
| Parameter | Launch configs, runtime tuning (e.g., thresholds, IP addresses) |
| TF Frames | Camera, base_link, map, arm, all dynamically linked |
Typical Flow:
- Robot explores via Navigation Node
- Object Detector publishes
/target_poseon detection - Mission Manager interrupts navigation, coordinates approach, triggers pick/drop nodes
- Pick/Drop Node interacts with MyCobot, Mission resumes or returns
- All state and pose info flows through topics or actions
โก๏ธ System Coordination Exampleโ
- Normal Operation
- Interrupt & Error Handling
- Launch all nodes with
full_system.launch.py - Robot starts exploring waypoints
- Object is detected:
/target_posepublished - Mission Manager:
- Pauses exploration
- Sends goal to Navigation Node
- On arrival: triggers Pick Node
- Waits for success/failure
- Sends โreturn to baseโ goal
- Triggers Drop Node
- Resumes or finishes
- If Pick fails: Mission Manager reports error, may retry or abort
- If object detection is unstable: resumes exploration, waits for new target
- All errors logged, state managed in Mission Manager Node
๐ธ๏ธ How Each Node Communicatesโ
| Node | Publishes | Subscribes to | Actions/Services |
|---|---|---|---|
| Object Detector | /target_pose | Camera, Depth topics | โ |
| Mission Manager | Navigation goal, /cmd_vel | /target_pose, feedback | Triggers pick/drop |
| Navigation Node | Robot movement | Goal poses | NavigateToPose action |
| Pick/Drop Node | Arm/gripper commands | Trigger from Mission | โ |
| Pose Setter | Initial pose to Nav Node | Manual or launch | โ |
๐จโ๐ป System Integration Best Practicesโ
- Use launch files to manage startup dependencies and correct launch order (see
full_system.launch.py) - Keep all custom code in your external workspace
- Use actions for long-running tasks (navigation, arm movement), topics for rapid data/events
- Always test each node individually before full system bring-up
- Use RQT Graph and RViz to debug connections and visualize state