# junmyeongpark/lv2_liveeat_assignment architecture

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

- Interactive diagram: https://gitdiagram.com/junmyeongpark/lv2_liveeat_assignment
- Repository: https://github.com/junmyeongpark/lv2_liveeat_assignment

## Overview

Live.Eat is a ROS 2 vision-tracking robot system: camera frames become object detections and depth estimates; planning turns those inputs and robot state into base and arm commands; control converts commands to motor and serial operations, while OpenCR firmware drives actuators and reports state. The repository also includes detector backends and planning health/dashboard capabilities. Edges follow the sampled excerpts and explicit source comments; unsampled runtime wiring is omitted rather than inferred.

Main entry points: [`lv2_module5/ros2_ws/src/perception/src/perception_master.cpp`](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/perception_master.cpp) (Perception master), [`lv2_module5/ros2_ws/src/control/src/control_master.cpp`](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/control/src/control_master.cpp) (Control master), [`lv2_module5/ros2_ws/src/planning/planning/planning_master.py`](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/planning/planning/planning_master.py) (Planning master), [`lv2_module5/ros2_ws/src/perception/src/detector.cpp`](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/detector.cpp) (Object detector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_perception["Perception"]
  node_detector["Object detector<br/>[detector.cpp]"]
  node_ncnn["NCNN backend<br/>[ncnn_detector.cpp]"]
  node_onnx["ONNX backend<br/>[onnx_detector.cpp]"]
  node_depth["Depth extraction"]
  node_joint_reader["IMU joint reader"]
  node_perception_master["Perception master"]
end

subgraph group_planning["Planning"]
  node_planner["Planning master<br/>[planning_master.py]"]
  node_health["Health monitor<br/>[health_monitor.py]"]
  node_dashboard["Status dashboard<br/>[dashboard.py]"]
end

subgraph group_control["Control"]
  node_control_master["Control master<br/>[control_master.cpp]"]
  node_kinematics["Base kinematics"]
  node_arm_command["Arm commands<br/>[arm_command.cpp]"]
  node_serial_bridge["Serial bridge<br/>[serial_bridge.cpp]"]
end

subgraph group_firmware["OpenCR firmware"]
  node_firmware_protocol["Serial protocol"]
  node_motor_driver["Motor driver<br/>[motor_driver.cpp]"]
  node_imu_reader["Firmware IMU reader<br/>[imu_reader.cpp]"]
  node_watchdog["Command watchdog<br/>[watchdog.cpp]"]
end

node_camera(("RGB-D camera"))
node_actuators(("Dynamixel motors"))

node_camera -->|"sends frames"| node_perception_master
node_perception_master -->|"runs detection"| node_detector
node_perception_master -->|"extracts depth"| node_depth
node_detector -.->|"selects backend"| node_ncnn
node_detector -.->|"selects backend"| node_onnx
node_perception_master -.->|"reads robot state"| node_joint_reader
node_perception_master -->|"publishes detection"| node_planner
node_planner -->|"publishes commands"| node_control_master
node_control_master -->|"publishes state"| node_planner
node_control_master -->|"computes wheel targets"| node_kinematics
node_control_master -->|"updates arm target"| node_arm_command
node_control_master -->|"sends and receives"| node_serial_bridge
node_serial_bridge -.->|"exchanges packets"| node_firmware_protocol
node_firmware_protocol -->|"passes commands and state"| node_motor_driver
node_motor_driver -->|"drives motors"| node_actuators
node_watchdog -.->|"limits timed-out motion"| node_motor_driver
node_imu_reader -.->|"provides IMU readings"| node_firmware_protocol
node_planner -.->|"checks health"| node_health
node_planner -->|"updates dashboard"| node_dashboard

click node_detector "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/detector.cpp"
click node_ncnn "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/ncnn_detector.cpp"
click node_onnx "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/onnx_detector.cpp"
click node_depth "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/depth_extractor.cpp"
click node_joint_reader "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/imu_joint_reader.cpp"
click node_perception_master "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/perception_master.cpp"
click node_planner "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/planning/planning/planning_master.py"
click node_health "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/planning/planning/health_monitor.py"
click node_dashboard "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/planning/planning/dashboard.py"
click node_control_master "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/control/src/control_master.cpp"
click node_kinematics "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/control/src/base_kinematics.cpp"
click node_arm_command "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/control/src/arm_command.cpp"
click node_serial_bridge "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/control/src/serial_bridge.cpp"
click node_firmware_protocol "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/firmware/opencr_firmware/serial_protocol.cpp"
click node_motor_driver "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/firmware/opencr_firmware/motor_driver.cpp"
click node_imu_reader "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/firmware/opencr_firmware/imu_reader.cpp"
click node_watchdog "https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/firmware/opencr_firmware/watchdog.cpp"

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_detector,node_ncnn,node_onnx,node_depth,node_joint_reader,node_perception_master toneBlue
class node_planner,node_health,node_dashboard toneAmber
class node_control_master,node_kinematics,node_arm_command,node_serial_bridge toneMint
class node_firmware_protocol,node_motor_driver,node_imu_reader,node_watchdog toneRose
class node_camera,node_actuators toneIndigo
```

## Components

### Perception

- [Object detector](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/detector.cpp): `lv2_module5/ros2_ws/src/perception/src/detector.cpp`
- [NCNN backend](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/ncnn_detector.cpp): `lv2_module5/ros2_ws/src/perception/src/ncnn_detector.cpp`
- [ONNX backend](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/onnx_detector.cpp): `lv2_module5/ros2_ws/src/perception/src/onnx_detector.cpp`
- [Depth extraction](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/depth_extractor.cpp): `lv2_module5/ros2_ws/src/perception/src/depth_extractor.cpp`
- [IMU joint reader](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/imu_joint_reader.cpp): `lv2_module5/ros2_ws/src/perception/src/imu_joint_reader.cpp`
- [Perception master](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/perception/src/perception_master.cpp): `lv2_module5/ros2_ws/src/perception/src/perception_master.cpp`

### Planning

- [Planning master](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/planning/planning/planning_master.py): `lv2_module5/ros2_ws/src/planning/planning/planning_master.py`
- [Health monitor](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/planning/planning/health_monitor.py): `lv2_module5/ros2_ws/src/planning/planning/health_monitor.py`
- [Status dashboard](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/planning/planning/dashboard.py): `lv2_module5/ros2_ws/src/planning/planning/dashboard.py`

### Control

- [Control master](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/control/src/control_master.cpp): `lv2_module5/ros2_ws/src/control/src/control_master.cpp`
- [Base kinematics](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/control/src/base_kinematics.cpp): `lv2_module5/ros2_ws/src/control/src/base_kinematics.cpp`
- [Arm commands](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/control/src/arm_command.cpp): `lv2_module5/ros2_ws/src/control/src/arm_command.cpp`
- [Serial bridge](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/ros2_ws/src/control/src/serial_bridge.cpp): `lv2_module5/ros2_ws/src/control/src/serial_bridge.cpp`

### OpenCR firmware

- [Serial protocol](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/firmware/opencr_firmware/serial_protocol.cpp): `lv2_module5/firmware/opencr_firmware/serial_protocol.cpp`
- [Motor driver](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/firmware/opencr_firmware/motor_driver.cpp): `lv2_module5/firmware/opencr_firmware/motor_driver.cpp`
- [Firmware IMU reader](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/firmware/opencr_firmware/imu_reader.cpp): `lv2_module5/firmware/opencr_firmware/imu_reader.cpp`
- [Command watchdog](https://github.com/junmyeongpark/lv2_liveeat_assignment/blob/main/lv2_module5/firmware/opencr_firmware/watchdog.cpp): `lv2_module5/firmware/opencr_firmware/watchdog.cpp`

### Other components

- **RGB-D camera**
- **Dynamixel motors**

## Connections

- RGB-D camera → Perception master: sends frames (evidence: `lv2_module5/ros2_ws/src/perception/src/perception_master.cpp`)
- Perception master → Object detector: runs detection (evidence: `lv2_module5/ros2_ws/src/perception/src/perception_master.cpp`)
- Perception master → Depth extraction: extracts depth (evidence: `lv2_module5/ros2_ws/src/perception/src/perception_master.cpp`)
- Object detector → NCNN backend: selects backend
- Object detector → ONNX backend: selects backend
- Perception master → IMU joint reader: reads robot state
- Perception master → Planning master: publishes detection (evidence: `lv2_module5/ros2_ws/src/perception/src/perception_master.cpp`)
- Planning master → Control master: publishes commands (evidence: `lv2_module5/ros2_ws/src/control/src/control_master.cpp`)
- Control master → Planning master: publishes state (evidence: `lv2_module5/ros2_ws/src/control/src/control_master.cpp`)
- Control master → Base kinematics: computes wheel targets (evidence: `lv2_module5/ros2_ws/src/control/src/control_master.cpp`)
- Control master → Arm commands: updates arm target (evidence: `lv2_module5/ros2_ws/src/control/src/control_master.cpp`)
- Control master → Serial bridge: sends and receives (evidence: `lv2_module5/ros2_ws/src/control/src/control_master.cpp`)
- Serial bridge → Serial protocol: exchanges packets
- Serial protocol → Motor driver: passes commands and state (evidence: `lv2_module5/firmware/opencr_firmware/serial_protocol.cpp`)
- Motor driver → Dynamixel motors: drives motors (evidence: `lv2_module5/firmware/opencr_firmware/motor_driver.cpp`)
- Command watchdog → Motor driver: limits timed-out motion
- Firmware IMU reader → Serial protocol: provides IMU readings
- Planning master → Health monitor: checks health (evidence: `lv2_module5/ros2_ws/src/planning/planning/planning_master.py`)
- Planning master → Status dashboard: updates dashboard (evidence: `lv2_module5/ros2_ws/src/planning/planning/planning_master.py`)
