Low-cost ROS 2 Jazzy CNC Plotter with LLM Agent & RViz Digital Twin

Hi everyone,

I wanted to share an open-source project I’ve been working on to experiment with agentic workflows in ROS 2: a custom 2-axis CNC plotter controlled via natural language using an LLM Agent.

The Goal: I wanted to move away from strict pre-programming and explore how an LLM agent could utilize registered ROS tools (in this case, CNC axis control) to fulfill abstract requests.

System Architecture:

  • Hardware: 2-axis mechanism using stepper motors salvaged from CD-ROM drives.

  • Compute: Raspberry Pi (ROS 2 Jazzy) + Arduino (GRBL firmware).

  • Digital Twin: A real-time RViz visualization that mirrors the machine’s state.

How it works:

  1. Agent Node: A custom llm_commander node (built with the OpenAI Agents SDK) accepts natural language (e.g., “draw a square”).

  2. Tool Use: The agent parses the intent and uses a registered draw_shape tool to generate path coordinates.

  3. Execution: Coordinates are sent to a grbl_driver node, which drives the physical motors while simultaneously publishing joint states to update the URDF model in RViz.

Tech Stack:

  • ROS 2 Jazzy

  • Python

  • GRBL

  • OpenAI Agents SDK

Repository: :link: https://github.com/yacin-hamdi/ros-pi-cnc

Connect: https://www.linkedin.com/in/yacin-hamdi-53825721b/

I’m particularly interested in feedback on the bridge between the Agent SDK and the ROS 2 action/service layer. If you have any thoughts or suggestions on the approach, I’d love to hear them!

small_out

1 Like