# liangc001/go2-patrol-nav architecture

> Architecture diagram of the GitHub repository liangc001/go2-patrol-nav, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/liangc001/go2-patrol-nav
- Repository: https://github.com/liangc001/go2-patrol-nav

## Overview

GO2-Patrol-Nav combines robot mapping and navigation, patrol-path authoring and execution, YOLOv5 image monitoring, and WebRTC remote operation. The documented operator workflow is to map an environment, save a map, create a route, then simulate or execute it; detection and remote control are parallel capabilities. README statements support the principal cross-system links; sampled source is limited, so internal ROS topic wiring and several runtime integrations are not asserted.

Main entry points: [`go2_ros2_ws/path_runner.py`](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/path_runner.py) (Path runner), [`Target_Detect/yolov5/detect.py`](https://github.com/liangc001/go2-patrol-nav/blob/master/Target_Detect/yolov5/detect.py) (YOLO inference), [`go2_ros2_ws/path_planner.py`](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/path_planner.py) (Path planner), [`go2_ros2_ws/src/go2_ros2_toolbox/go2_slam/launch/go2_slamtoolbox.launch.py`](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/go2_slam/launch/go2_slamtoolbox.launch.py) (SLAM launch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Operator control"]
  node_web["Web console service<br/>[server.py]"]
end

subgraph group_routes["Patrol paths"]
  node_planner["Path planner<br/>[path_planner.py]"]
  node_route_file["Route commands"]
  node_runner["Path runner<br/>[path_runner.py]"]
  node_simulator["Path simulator<br/>[path_simulate.py]"]
end

subgraph group_robot["ROS robot stack"]
  node_core["Go2 core<br/>[go2_base.cpp]"]
  node_video["Video stream node"]
  node_slam["SLAM launch"]
  node_navigation["Navigation launch<br/>[go2_nav2.launch.py]"]
  node_sport["Sport control API"]
end

subgraph group_vision["Perception and detection"]
  node_pointcloud["Pointcloud processing"]
  node_detection_monitor["Detection monitor"]
  node_yolo_inference["YOLO inference<br/>[detect.py]"]
  node_yolo_model["YOLO model modules<br/>[yolo.py]"]
  node_yolo_components["Model components"]
  node_yolo_utils["Data and runtime utilities"]
  node_detection_results["Detection result folders"]
end

subgraph group_remote["Remote communications"]
  node_webrtc["WebRTC driver<br/>[webrtc_driver.py]"]
  node_tcp_bridge["Navigation TCP bridge"]
end

node_operator(("Operator"))
node_robot_actor(("Go2 robot"))

node_operator -->|"plans route"| node_planner
node_planner -->|"saves commands"| node_route_file
node_route_file -->|"provides commands"| node_runner
node_runner -->|"executes patrol"| node_robot_actor
node_runner -->|"offers simulation"| node_simulator
node_operator -->|"starts mapping"| node_slam
node_slam -->|"starts core"| node_core
node_operator -.->|"starts navigation"| node_navigation
node_operator -->|"starts monitoring"| node_detection_monitor
node_detection_monitor -->|"runs detection"| node_yolo_inference
node_yolo_inference -->|"sorts images"| node_detection_results
node_yolo_model -->|"uses modules"| node_yolo_components
node_yolo_inference -->|"uses utilities"| node_yolo_utils
node_operator -->|"uses remote control"| node_webrtc
node_webrtc -->|"communicates remotely"| node_robot_actor
node_video -.->|"streams video"| node_robot_actor
node_pointcloud -.->|"supports sensing"| node_navigation
node_tcp_bridge -.->|"bridges commands"| node_sport
node_web -.->|"serves console"| node_operator

click node_web "https://github.com/liangc001/go2-patrol-nav/blob/master/go2_launch_sh/server.py"
click node_planner "https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/path_planner.py"
click node_runner "https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/path_runner.py"
click node_simulator "https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/path_simulate.py"
click node_core "https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/go2_core/src/go2_base.cpp"
click node_video "https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/go2_core/go2_core/video_stream_node.py"
click node_slam "https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/go2_slam/launch/go2_slamtoolbox.launch.py"
click node_navigation "https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/go2_navigation/launch/go2_nav2.launch.py"
click node_sport "https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/unitree_pkgs/go2_sport_api/src/common/ros2_sport_client.cpp"
click node_pointcloud "https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/go2_perception/src/pointcloud_to_laserscan_node.cpp"
click node_detection_monitor "https://github.com/liangc001/go2-patrol-nav/blob/master/Target_Detect/monitor_detect_target.py"
click node_yolo_inference "https://github.com/liangc001/go2-patrol-nav/blob/master/Target_Detect/yolov5/detect.py"
click node_yolo_model "https://github.com/liangc001/go2-patrol-nav/blob/master/Target_Detect/yolov5/models/yolo.py"
click node_yolo_components "https://github.com/liangc001/go2-patrol-nav/tree/master/Target_Detect/yolov5/models"
click node_yolo_utils "https://github.com/liangc001/go2-patrol-nav/tree/master/Target_Detect/yolov5/utils"
click node_webrtc "https://github.com/liangc001/go2-patrol-nav/blob/master/go2_webrtc_connect/go2_webrtc_driver/webrtc_driver.py"
click node_tcp_bridge "https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/go2_navigation/go2_navigation/navigation_command_tcpbridge.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web toneBlue
class node_planner,node_route_file,node_runner,node_simulator toneAmber
class node_core,node_video,node_slam,node_navigation,node_sport toneMint
class node_pointcloud,node_detection_monitor,node_yolo_inference,node_yolo_model,node_yolo_components,node_yolo_utils,node_detection_results toneRose
class node_webrtc,node_tcp_bridge,node_operator,node_robot_actor toneIndigo
```

## Components

### Operator control

- [Web console service](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_launch_sh/server.py): `go2_launch_sh/server.py`

### Patrol paths

- [Path planner](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/path_planner.py): `go2_ros2_ws/path_planner.py`
- **Route commands**
- [Path runner](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/path_runner.py): `go2_ros2_ws/path_runner.py`
- [Path simulator](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/path_simulate.py): `go2_ros2_ws/path_simulate.py`

### ROS robot stack

- [Go2 core](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/go2_core/src/go2_base.cpp): `go2_ros2_ws/src/go2_ros2_toolbox/go2_core/src/go2_base.cpp`
- [Video stream node](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/go2_core/go2_core/video_stream_node.py): `go2_ros2_ws/src/go2_ros2_toolbox/go2_core/go2_core/video_stream_node.py`
- [SLAM launch](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/go2_slam/launch/go2_slamtoolbox.launch.py): `go2_ros2_ws/src/go2_ros2_toolbox/go2_slam/launch/go2_slamtoolbox.launch.py`
- [Navigation launch](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/go2_navigation/launch/go2_nav2.launch.py): `go2_ros2_ws/src/go2_ros2_toolbox/go2_navigation/launch/go2_nav2.launch.py`
- [Sport control API](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/unitree_pkgs/go2_sport_api/src/common/ros2_sport_client.cpp): `go2_ros2_ws/src/go2_ros2_toolbox/unitree_pkgs/go2_sport_api/src/common/ros2_sport_client.cpp`

### Perception and detection

- [Pointcloud processing](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/go2_perception/src/pointcloud_to_laserscan_node.cpp): `go2_ros2_ws/src/go2_ros2_toolbox/go2_perception/src/pointcloud_to_laserscan_node.cpp`
- [Detection monitor](https://github.com/liangc001/go2-patrol-nav/blob/master/Target_Detect/monitor_detect_target.py): `Target_Detect/monitor_detect_target.py`
- [YOLO inference](https://github.com/liangc001/go2-patrol-nav/blob/master/Target_Detect/yolov5/detect.py): `Target_Detect/yolov5/detect.py`
- [YOLO model modules](https://github.com/liangc001/go2-patrol-nav/blob/master/Target_Detect/yolov5/models/yolo.py): `Target_Detect/yolov5/models/yolo.py`
- [Model components](https://github.com/liangc001/go2-patrol-nav/tree/master/Target_Detect/yolov5/models): `Target_Detect/yolov5/models`
- [Data and runtime utilities](https://github.com/liangc001/go2-patrol-nav/tree/master/Target_Detect/yolov5/utils): `Target_Detect/yolov5/utils`
- **Detection result folders**

### Remote communications

- [WebRTC driver](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_webrtc_connect/go2_webrtc_driver/webrtc_driver.py): `go2_webrtc_connect/go2_webrtc_driver/webrtc_driver.py`
- [Navigation TCP bridge](https://github.com/liangc001/go2-patrol-nav/blob/master/go2_ros2_ws/src/go2_ros2_toolbox/go2_navigation/go2_navigation/navigation_command_tcpbridge.py): `go2_ros2_ws/src/go2_ros2_toolbox/go2_navigation/go2_navigation/navigation_command_tcpbridge.py`

### Other components

- **Operator**
- **Go2 robot**

## Connections

- Operator → Path planner: plans route
- Path planner → Route commands: saves commands
- Route commands → Path runner: provides commands
- Path runner → Go2 robot: executes patrol
- Path runner → Path simulator: offers simulation
- Operator → SLAM launch: starts mapping
- SLAM launch → Go2 core: starts core
- Operator → Navigation launch: starts navigation
- Operator → Detection monitor: starts monitoring
- Detection monitor → YOLO inference: runs detection
- YOLO inference → Detection result folders: sorts images
- YOLO model modules → Model components: uses modules (evidence: `Target_Detect/yolov5/models/yolo.py`)
- YOLO inference → Data and runtime utilities: uses utilities (evidence: `Target_Detect/yolov5/utils/dataloaders.py`)
- Operator → WebRTC driver: uses remote control
- WebRTC driver → Go2 robot: communicates remotely
- Video stream node → Go2 robot: streams video
- Pointcloud processing → Navigation launch: supports sensing
- Navigation TCP bridge → Sport control API: bridges commands
- Web console service → Operator: serves console
