# quanjb/hri_thuc_hanh architecture

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

- Interactive diagram: https://gitdiagram.com/quanjb/hri_thuc_hanh
- Repository: https://github.com/quanjb/hri_thuc_hanh

## Overview

This ROS 2 package turns a text request (currently only “Q”) into robot drawing waypoints, previews the path in RViz, then asks MoveIt to approach the start and execute a Cartesian trajectory. Its main runtime is two Python nodes joined by a custom service; a launch file starts them together, while a separate launch file brings up UR3 simulation. The README describes an unrelated TurtleBot navigation system, so it does not document this package’s capabilities. Relationships below are based on the sampled source; MoveIt and RViz are external dependencies.

Main entry points: [`src/ur3_text_drawer/ur3_text_drawer/moveit_executor_node.py`](https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/ur3_text_drawer/moveit_executor_node.py) (MoveIt executor node), [`src/ur3_text_drawer/launch/draw_text_app.launch.py`](https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/launch/draw_text_app.launch.py) (Drawing app launch), [`src/ur3_text_drawer/ur3_text_drawer/text_to_waypoints_node.py`](https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/ur3_text_drawer/text_to_waypoints_node.py) (Text-to-waypoints node), [`src/ur3_text_drawer/launch/ur3_sim_bringup.launch.py`](https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/launch/ur3_sim_bringup.launch.py) (UR3 simulation launch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launching["Launch and simulation"]
  node_draw_launch["Drawing app launch"]
  node_sim_launch["UR3 simulation launch"]
end

subgraph group_generation["Trajectory generation"]
  node_text_request["Text trajectory service"]
  node_waypoint_node["Text-to-waypoints node"]
end

subgraph group_execution["Robot execution"]
  node_executor["MoveIt executor node"]
end

node_operator(("Operator"))
node_ur_sim["UR simulation MoveIt"]
node_rviz["RViz"]
node_cartesian_service["Cartesian path service"]
node_move_group["MoveGroup action"]
node_execute_trajectory["Execute trajectory action"]

node_operator -->|"starts"| node_draw_launch
node_operator -->|"starts"| node_sim_launch
node_draw_launch -->|"launches"| node_waypoint_node
node_draw_launch -->|"launches"| node_executor
node_sim_launch -->|"includes"| node_ur_sim
node_executor -->|"requests"| node_text_request
node_waypoint_node -->|"serves"| node_text_request
node_waypoint_node -->|"publishes preview"| node_rviz
node_executor -->|"plans approach"| node_move_group
node_executor -->|"computes path"| node_cartesian_service
node_executor -->|"executes path"| node_execute_trajectory

click node_draw_launch "https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/launch/draw_text_app.launch.py"
click node_sim_launch "https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/launch/ur3_sim_bringup.launch.py"
click node_text_request "https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/srv/GenerateTextTrajectory.srv"
click node_waypoint_node "https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/ur3_text_drawer/text_to_waypoints_node.py"
click node_executor "https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/ur3_text_drawer/moveit_executor_node.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_draw_launch,node_sim_launch toneBlue
class node_text_request,node_waypoint_node toneAmber
class node_executor toneMint
class node_operator,node_ur_sim,node_rviz,node_cartesian_service,node_move_group,node_execute_trajectory toneIndigo
```

## Components

### Launch and simulation

- [Drawing app launch](https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/launch/draw_text_app.launch.py): `src/ur3_text_drawer/launch/draw_text_app.launch.py`
- [UR3 simulation launch](https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/launch/ur3_sim_bringup.launch.py): `src/ur3_text_drawer/launch/ur3_sim_bringup.launch.py`

### Trajectory generation

- [Text trajectory service](https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/srv/GenerateTextTrajectory.srv): `src/ur3_text_drawer/srv/GenerateTextTrajectory.srv`
- [Text-to-waypoints node](https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/ur3_text_drawer/text_to_waypoints_node.py): `src/ur3_text_drawer/ur3_text_drawer/text_to_waypoints_node.py`

### Robot execution

- [MoveIt executor node](https://github.com/quanjb/hri_thuc_hanh/blob/tuan_1/src/ur3_text_drawer/ur3_text_drawer/moveit_executor_node.py): `src/ur3_text_drawer/ur3_text_drawer/moveit_executor_node.py`

### Other components

- **Operator**
- **UR simulation MoveIt**
- **RViz**
- **Cartesian path service**
- **MoveGroup action**
- **Execute trajectory action**

## Connections

- Operator → Drawing app launch: starts (evidence: `src/ur3_text_drawer/launch/draw_text_app.launch.py`)
- Operator → UR3 simulation launch: starts (evidence: `src/ur3_text_drawer/launch/ur3_sim_bringup.launch.py`)
- Drawing app launch → Text-to-waypoints node: launches (evidence: `src/ur3_text_drawer/launch/draw_text_app.launch.py`)
- Drawing app launch → MoveIt executor node: launches (evidence: `src/ur3_text_drawer/launch/draw_text_app.launch.py`)
- UR3 simulation launch → UR simulation MoveIt: includes (evidence: `src/ur3_text_drawer/launch/ur3_sim_bringup.launch.py`)
- MoveIt executor node → Text trajectory service: requests (evidence: `src/ur3_text_drawer/ur3_text_drawer/moveit_executor_node.py`)
- Text-to-waypoints node → Text trajectory service: serves (evidence: `src/ur3_text_drawer/ur3_text_drawer/text_to_waypoints_node.py`)
- Text-to-waypoints node → RViz: publishes preview (evidence: `src/ur3_text_drawer/ur3_text_drawer/text_to_waypoints_node.py`)
- MoveIt executor node → MoveGroup action: plans approach (evidence: `src/ur3_text_drawer/ur3_text_drawer/moveit_executor_node.py`)
- MoveIt executor node → Cartesian path service: computes path (evidence: `src/ur3_text_drawer/ur3_text_drawer/moveit_executor_node.py`)
- MoveIt executor node → Execute trajectory action: executes path (evidence: `src/ur3_text_drawer/ur3_text_drawer/moveit_executor_node.py`)
