# game-r-over/xrc_rover architecture

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

- Interactive diagram: https://gitdiagram.com/game-r-over/xrc_rover
- Repository: https://github.com/game-r-over/xrc_rover

## Overview

This repository is a staged ROS 2 learning assignment: learners set up a ROS Humble environment, build a publisher/subscriber flow, then add a custom position-check service. The runtime path is interactive commands published as Twist messages, accumulated by a subscriber, and checked through the service. The source excerpts establish those runtime calls; the README documents the setup and learning stages. The Docker environment’s detailed runtime wiring is not shown, so it is represented only as a documented setup capability.

Main entry points: [`rover_commands/rover_commands/publisher.py`](https://github.com/game-r-over/xrc_rover/blob/master/rover_commands/rover_commands/publisher.py) (Trajectory Publisher), [`rover_commands/rover_commands/subscriber.py`](https://github.com/game-r-over/xrc_rover/blob/master/rover_commands/rover_commands/subscriber.py) (Trajectory Subscriber), [`rover_commands/rover_commands/check_position_server.py`](https://github.com/game-r-over/xrc_rover/blob/master/rover_commands/rover_commands/check_position_server.py) (Position Check Server), [`custom_msg/srv/CheckPosition.srv`](https://github.com/game-r-over/xrc_rover/blob/master/custom_msg/srv/CheckPosition.srv) (Position Check Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Environment Setup"]
  node_environment["Docker ROS Humble"]
  node_level1["Setup Guide<br/>[Level1.md]"]
end

subgraph group_messaging["ROS Messaging"]
  node_input["Direction Input<br/>[publisher.py]"]
  node_publisher["Trajectory Publisher<br/>[publisher.py]"]
  node_position_topic["position Topic"]
  node_subscriber["Trajectory Subscriber<br/>[subscriber.py]"]
  node_twist["Twist Message"]
  node_level2["Package Communication<br/>[Level2.md]"]
end

subgraph group_position["Position Checking"]
  node_position_service["Position Check Service<br/>[CheckPosition.srv]"]
  node_server["Position Check Server"]
  node_level3["Service Integration<br/>[Level3.md]"]
end

node_learner(("Learner"))

node_learner -->|"sets up"| node_environment
node_learner -->|"follows"| node_level1
node_learner -->|"implements"| node_level2
node_learner -->|"implements"| node_level3
node_input -->|"provides commands"| node_publisher
node_publisher -->|"publishes"| node_twist
node_publisher -->|"publishes on"| node_position_topic
node_position_topic -->|"delivers messages"| node_subscriber
node_subscriber -->|"requests"| node_position_service
node_subscriber -->|"calls"| node_server
node_server -->|"serves"| node_position_service

click node_level1 "https://github.com/game-r-over/xrc_rover/blob/master/docs/Level1.md"
click node_input "https://github.com/game-r-over/xrc_rover/blob/master/rover_commands/rover_commands/publisher.py"
click node_publisher "https://github.com/game-r-over/xrc_rover/blob/master/rover_commands/rover_commands/publisher.py"
click node_subscriber "https://github.com/game-r-over/xrc_rover/blob/master/rover_commands/rover_commands/subscriber.py"
click node_position_service "https://github.com/game-r-over/xrc_rover/blob/master/custom_msg/srv/CheckPosition.srv"
click node_server "https://github.com/game-r-over/xrc_rover/blob/master/rover_commands/rover_commands/check_position_server.py"
click node_level2 "https://github.com/game-r-over/xrc_rover/blob/master/docs/Level2.md"
click node_level3 "https://github.com/game-r-over/xrc_rover/blob/master/docs/Level3.md"

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_environment,node_level1 toneBlue
class node_input,node_publisher,node_position_topic,node_subscriber,node_twist,node_level2 toneAmber
class node_position_service,node_server,node_level3 toneMint
class node_learner toneIndigo
```

## Components

### Environment Setup

- **Docker ROS Humble**
- [Setup Guide](https://github.com/game-r-over/xrc_rover/blob/master/docs/Level1.md): `docs/Level1.md`

### ROS Messaging

- [Direction Input](https://github.com/game-r-over/xrc_rover/blob/master/rover_commands/rover_commands/publisher.py): `rover_commands/rover_commands/publisher.py`
- [Trajectory Publisher](https://github.com/game-r-over/xrc_rover/blob/master/rover_commands/rover_commands/publisher.py): `rover_commands/rover_commands/publisher.py`
- **position Topic**
- [Trajectory Subscriber](https://github.com/game-r-over/xrc_rover/blob/master/rover_commands/rover_commands/subscriber.py): `rover_commands/rover_commands/subscriber.py`
- **Twist Message**
- [Package Communication](https://github.com/game-r-over/xrc_rover/blob/master/docs/Level2.md): `docs/Level2.md`

### Position Checking

- [Position Check Service](https://github.com/game-r-over/xrc_rover/blob/master/custom_msg/srv/CheckPosition.srv): `custom_msg/srv/CheckPosition.srv`
- [Position Check Server](https://github.com/game-r-over/xrc_rover/blob/master/rover_commands/rover_commands/check_position_server.py): `rover_commands/rover_commands/check_position_server.py`
- [Service Integration](https://github.com/game-r-over/xrc_rover/blob/master/docs/Level3.md): `docs/Level3.md`

### Other components

- **Learner**

## Connections

- Learner → Docker ROS Humble: sets up (evidence: `README.md`)
- Learner → Setup Guide: follows (evidence: `README.md`)
- Learner → Package Communication: implements (evidence: `README.md`)
- Learner → Service Integration: implements (evidence: `README.md`)
- Direction Input → Trajectory Publisher: provides commands (evidence: `rover_commands/rover_commands/publisher.py`)
- Trajectory Publisher → Twist Message: publishes (evidence: `rover_commands/rover_commands/publisher.py`)
- Trajectory Publisher → position Topic: publishes on (evidence: `rover_commands/rover_commands/publisher.py`)
- position Topic → Trajectory Subscriber: delivers messages (evidence: `rover_commands/rover_commands/subscriber.py`)
- Trajectory Subscriber → Position Check Service: requests (evidence: `rover_commands/rover_commands/subscriber.py`)
- Trajectory Subscriber → Position Check Server: calls (evidence: `README.md`)
- Position Check Server → Position Check Service: serves (evidence: `rover_commands/rover_commands/check_position_server.py`)
