# tranhungtdh06/sml_arm architecture

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

- Interactive diagram: https://gitdiagram.com/tranhungtdh06/sml_arm
- Repository: https://github.com/tranhungtdh06/sml_arm

## Overview

SML-Arm is an open-source six-axis robotic arm project spanning ROS 2 simulation and motion control, desktop operator tools, and scaffolded MCU/hardware subsystems. The main user workflow is to launch a simulated or mock arm, issue joint or Cartesian motion through the GUI/CLI or pick-and-place demo, and have the control stack plan and execute it against the robot model. The graph also preserves the separate serial-firmware workflow and physical/electrical design areas. Some ROS launch and firmware implementation details are unsampled; uncertain links are omitted or marked dashed.

Main entry points: [`src/sml_arm_bringup/launch`](https://github.com/tranhungtdh06/sml_arm/tree/main/src/sml_arm_bringup/launch) (System launch), [`src/sml_arm_control/scripts/arm_kinematics.py`](https://github.com/tranhungtdh06/sml_arm/blob/main/src/sml_arm_control/scripts/arm_kinematics.py) (FK / IK), [`firmware/mcu_controller/tools/sml_arm_gui/main_window.py`](https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/tools/sml_arm_gui/main_window.py) (Hardware test GUI), [`firmware/mcu_controller/lib/robot/robot.cpp`](https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/lib/robot/robot.cpp) (Joint coordination)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ros["ROS 2 Control"]
  node_bringup["System launch"]
  node_robot_model["Robot model"]
  node_gazebo["Gazebo workcell"]
  node_ros_control["ros2_control"]
  node_moveit["MoveIt planning"]
end

subgraph group_operator["Operator Tools"]
  node_gui["Control Studio<br/>[arm_control_gui.py]"]
  node_commander["Arm CLI<br/>[arm_commander.py]"]
  node_kinematics["FK / IK<br/>[arm_kinematics.py]"]
  node_pick_place["Pick-and-place"]
  node_calibration_sync["Calibration sync"]
  node_firmware_gui["Hardware test GUI<br/>[main_window.py]"]
  node_serial["Serial transport<br/>[serial_manager.py]"]
  node_command_client["Command client<br/>[command_client.py]"]
end

subgraph group_firmware["MCU Firmware"]
  node_mcu_entry["Firmware entry<br/>[main.cpp]"]
  node_serial_commands["Command interface<br/>[tool.cpp]"]
  node_robot_coord["Joint coordination<br/>[robot.cpp]"]
  node_joint_motion["Joint motion<br/>[joint.cpp]"]
  node_stepper_driver["Stepper driver<br/>[stepper.cpp]"]
  node_protocol["Shared protocol<br/>[sml_arm_protocol.h]"]
end

subgraph group_physical["Physical Design"]
  node_mechanical["Mechanical design"]
  node_electrical["Electrical design"]
end

node_user(("Arm operator"))

node_user -->|"starts system"| node_bringup
node_bringup -->|"launches simulation"| node_gazebo
node_bringup -->|"starts control"| node_ros_control
node_bringup -->|"starts planning"| node_moveit
node_bringup -->|"loads model"| node_robot_model
node_user -->|"operates arm"| node_gui
node_user -->|"issues commands"| node_commander
node_user -->|"requests FK / IK"| node_kinematics
node_user -->|"runs demo"| node_pick_place
node_gui -->|"uses solver"| node_kinematics
node_pick_place -->|"uses motion utilities"| node_kinematics
node_calibration_sync -->|"updates limits"| node_kinematics
node_user -.->|"tests hardware"| node_firmware_gui
node_firmware_gui -->|"uses transport"| node_serial
node_firmware_gui -->|"sends commands"| node_command_client
node_mcu_entry -->|"initializes and polls"| node_serial_commands
node_mcu_entry -->|"initializes robot"| node_robot_coord
node_robot_coord -->|"delegates motion"| node_joint_motion
node_robot_coord -->|"attaches motors"| node_stepper_driver
node_serial -.->|"exchanges commands"| node_mcu_entry
node_mechanical -.->|"informs geometry"| node_robot_model
node_electrical -.->|"supports wiring"| node_stepper_driver

click node_bringup "https://github.com/tranhungtdh06/sml_arm/tree/main/src/sml_arm_bringup/launch"
click node_robot_model "https://github.com/tranhungtdh06/sml_arm/tree/main/src/sml_arm_description/urdf"
click node_gazebo "https://github.com/tranhungtdh06/sml_arm/tree/main/src/sml_arm_gazebo"
click node_ros_control "https://github.com/tranhungtdh06/sml_arm/blob/main/src/sml_arm_control/config/sml_arm_controllers.yaml"
click node_moveit "https://github.com/tranhungtdh06/sml_arm/tree/main/src/sml_arm_moveit_config"
click node_gui "https://github.com/tranhungtdh06/sml_arm/blob/main/src/sml_arm_control/scripts/arm_control_gui.py"
click node_commander "https://github.com/tranhungtdh06/sml_arm/blob/main/src/sml_arm_control/scripts/arm_commander.py"
click node_kinematics "https://github.com/tranhungtdh06/sml_arm/blob/main/src/sml_arm_control/scripts/arm_kinematics.py"
click node_pick_place "https://github.com/tranhungtdh06/sml_arm/blob/main/src/sml_arm_control/scripts/pick_and_place_demo.py"
click node_calibration_sync "https://github.com/tranhungtdh06/sml_arm/blob/main/src/sml_arm_control/scripts/sync_calibration.py"
click node_firmware_gui "https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/tools/sml_arm_gui/main_window.py"
click node_serial "https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/tools/sml_arm_gui/serial_manager.py"
click node_command_client "https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/tools/sml_arm_gui/command_client.py"
click node_mcu_entry "https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/src/main.cpp"
click node_serial_commands "https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/lib/tool/tool.cpp"
click node_robot_coord "https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/lib/robot/robot.cpp"
click node_joint_motion "https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/lib/joint/joint.cpp"
click node_stepper_driver "https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/lib/stepper/stepper.cpp"
click node_protocol "https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/protocol/sml_arm_protocol.h"
click node_mechanical "https://github.com/tranhungtdh06/sml_arm/tree/main/hardware"
click node_electrical "https://github.com/tranhungtdh06/sml_arm/tree/main/electrical"

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_bringup,node_robot_model,node_gazebo,node_ros_control,node_moveit toneBlue
class node_gui,node_commander,node_kinematics,node_pick_place,node_calibration_sync,node_firmware_gui,node_serial,node_command_client toneAmber
class node_mcu_entry,node_serial_commands,node_robot_coord,node_joint_motion,node_stepper_driver,node_protocol toneMint
class node_mechanical,node_electrical toneRose
class node_user toneIndigo
```

## Components

### ROS 2 Control

- [System launch](https://github.com/tranhungtdh06/sml_arm/tree/main/src/sml_arm_bringup/launch): `src/sml_arm_bringup/launch`
- [Robot model](https://github.com/tranhungtdh06/sml_arm/tree/main/src/sml_arm_description/urdf): `src/sml_arm_description/urdf`
- [Gazebo workcell](https://github.com/tranhungtdh06/sml_arm/tree/main/src/sml_arm_gazebo): `src/sml_arm_gazebo`
- [ros2_control](https://github.com/tranhungtdh06/sml_arm/blob/main/src/sml_arm_control/config/sml_arm_controllers.yaml): `src/sml_arm_control/config/sml_arm_controllers.yaml`
- [MoveIt planning](https://github.com/tranhungtdh06/sml_arm/tree/main/src/sml_arm_moveit_config): `src/sml_arm_moveit_config`

### Operator Tools

- [Control Studio](https://github.com/tranhungtdh06/sml_arm/blob/main/src/sml_arm_control/scripts/arm_control_gui.py): `src/sml_arm_control/scripts/arm_control_gui.py`
- [Arm CLI](https://github.com/tranhungtdh06/sml_arm/blob/main/src/sml_arm_control/scripts/arm_commander.py): `src/sml_arm_control/scripts/arm_commander.py`
- [FK / IK](https://github.com/tranhungtdh06/sml_arm/blob/main/src/sml_arm_control/scripts/arm_kinematics.py): `src/sml_arm_control/scripts/arm_kinematics.py`
- [Pick-and-place](https://github.com/tranhungtdh06/sml_arm/blob/main/src/sml_arm_control/scripts/pick_and_place_demo.py): `src/sml_arm_control/scripts/pick_and_place_demo.py`
- [Calibration sync](https://github.com/tranhungtdh06/sml_arm/blob/main/src/sml_arm_control/scripts/sync_calibration.py): `src/sml_arm_control/scripts/sync_calibration.py`
- [Hardware test GUI](https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/tools/sml_arm_gui/main_window.py): `firmware/mcu_controller/tools/sml_arm_gui/main_window.py`
- [Serial transport](https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/tools/sml_arm_gui/serial_manager.py): `firmware/mcu_controller/tools/sml_arm_gui/serial_manager.py`
- [Command client](https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/tools/sml_arm_gui/command_client.py): `firmware/mcu_controller/tools/sml_arm_gui/command_client.py`

### MCU Firmware

- [Firmware entry](https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/src/main.cpp): `firmware/mcu_controller/src/main.cpp`
- [Command interface](https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/lib/tool/tool.cpp): `firmware/mcu_controller/lib/tool/tool.cpp`
- [Joint coordination](https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/lib/robot/robot.cpp): `firmware/mcu_controller/lib/robot/robot.cpp`
- [Joint motion](https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/lib/joint/joint.cpp): `firmware/mcu_controller/lib/joint/joint.cpp`
- [Stepper driver](https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/mcu_controller/lib/stepper/stepper.cpp): `firmware/mcu_controller/lib/stepper/stepper.cpp`
- [Shared protocol](https://github.com/tranhungtdh06/sml_arm/blob/main/firmware/protocol/sml_arm_protocol.h): `firmware/protocol/sml_arm_protocol.h`

### Physical Design

- [Mechanical design](https://github.com/tranhungtdh06/sml_arm/tree/main/hardware): `hardware`
- [Electrical design](https://github.com/tranhungtdh06/sml_arm/tree/main/electrical): `electrical`

### Other components

- **Arm operator**

## Connections

- Arm operator → System launch: starts system (evidence: `README.md`)
- System launch → Gazebo workcell: launches simulation (evidence: `README.md`)
- System launch → ros2_control: starts control (evidence: `README.md`)
- System launch → MoveIt planning: starts planning (evidence: `README.md`)
- System launch → Robot model: loads model (evidence: `README.md`)
- Arm operator → Control Studio: operates arm (evidence: `README.md`)
- Arm operator → Arm CLI: issues commands (evidence: `README.md`)
- Arm operator → FK / IK: requests FK / IK (evidence: `README.md`)
- Arm operator → Pick-and-place: runs demo (evidence: `README.md`)
- Control Studio → FK / IK: uses solver (evidence: `src/sml_arm_control/scripts/arm_control_gui.py`)
- Pick-and-place → FK / IK: uses motion utilities (evidence: `src/sml_arm_control/scripts/pick_and_place_demo.py`)
- Calibration sync → FK / IK: updates limits (evidence: `src/sml_arm_control/scripts/sync_calibration.py`)
- Arm operator → Hardware test GUI: tests hardware (evidence: `README.md`)
- Hardware test GUI → Serial transport: uses transport (evidence: `firmware/mcu_controller/tools/sml_arm_gui/main_window.py`)
- Hardware test GUI → Command client: sends commands (evidence: `firmware/mcu_controller/tools/sml_arm_gui/main_window.py`)
- Firmware entry → Command interface: initializes and polls (evidence: `firmware/mcu_controller/src/main.cpp`)
- Firmware entry → Joint coordination: initializes robot (evidence: `firmware/mcu_controller/src/main.cpp`)
- Joint coordination → Joint motion: delegates motion (evidence: `firmware/mcu_controller/lib/robot/robot.cpp`)
- Joint coordination → Stepper driver: attaches motors (evidence: `firmware/mcu_controller/lib/robot/robot.cpp`)
- Serial transport → Firmware entry: exchanges commands
- Mechanical design → Robot model: informs geometry
- Electrical design → Stepper driver: supports wiring
