Publishing XYZ Geometry from Grasshopper to ROS2 (C++ Real-Time)

Hello everyone,

I am currently working on a workflow that integrates Rhino/Grasshopper with ROS2, and I would appreciate some guidance on the next step.

My objective is to publish digital geometry generated in Grasshopper to another machine using ROS2.

So far, I have completed the following steps:

  1. I created a Grasshopper program that generates a digital shape in Rhino.

  2. The geometry is sliced, and I extract the coordinates of the points in XYZ format for each slice.

  3. On a separate machine, I have implemented a ROS2 subscriber that is ready to receive incoming data.

The challenge I am facing is the following:

I am not sure how to implement a ROS2 publisher that sends the XYZ coordinate data directly from Grasshopper to the other machine.

An important requirement of my project is that C++ is critical, because the final application needs to support real-time communication and execution.

My main questions are:

  • What is the recommended architecture for publishing data from Grasshopper/Rhino to ROS2?

  • Is it possible to implement a ROS2 publisher in C++ that interfaces with Grasshopper, or should Grasshopper export the data to an external C++ ROS2 node?

  • Are there any existing plugins, libraries, or example workflows demonstrating communication between Grasshopper and ROS2?

In summary, I already generate the XYZ coordinate data in Grasshopper, and I have a ROS2 subscriber running on another machine. My remaining task is to implement the ROS2 publisher connected to Grasshopper.

Any suggestions, references, or example implementations would be greatly appreciated.

Thank you for your time and assistance.

Hi, @Ame_Ali. Not being a developer myself, I’m replying to your request to bump this subject again. Your post seems like a good use case for asking AI for general direction and code starting points. I had some success copying/pasting your exact post into Grok, though you may want to choose a code-based LLM like Claude Code, ChatGPT Codex, or similar. Have you tried that yet?

you can right click and stream the contents of a panlel like so..

Thank you very much, and I apologize for the late reply.

Using LLMs is a good approach, especially if you clearly know the direction in which you want the solution to converge. In this work, a C# ROS 2 publisher is required, which needs to be integrated as a plugin within Grasshopper. Additionally, a ROS 2 package must be developed to receive the digital waypoints.

It is important that the communication protocol guarantees the correct sequencing of data. I found this approach effective, as it allows sending large trajectories—exceeding 100k points.

I have successfully integrated this setup with ROS 2. One important consideration is that if you are using Rhino on Windows, ROS 2 should run in WSL. The communication between them can be somewhat tricky, but it is manageable.

At this stage, I have a working ROS 2 plugin that allows direct publishing from Grasshopper, enabling the robot to start printing immediately.

Ame ALI

University of Lille

Thank you very much for your response. I would also like to point out that, for achieving full automation, this approach may still be insufficient.