Skip to content

dark516/ros2_arduino_bridge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS2 to Arduino Communication Node

This ROS2 node provides bidirectional communication between a ROS2 system (e.g., running on a Raspberry Pi) and an Arduino, using a request-response protocol over a serial port. The node can send control commands (e.g., motor speeds) to the Arduino and receive sensor data or status updates from it, publishing the received data to relevant ROS2 topics.

Features

  • Sends motor control commands or other data to Arduino.
  • Receives data packets from Arduino (e.g., sensor readings) and publishes them to appropriate ROS2 topics.
  • Uses a request-response protocol over a serial connection to ensure reliable data exchange.

Installation

Prerequirements

  • ROS2 Rolling (or your desired ROS2 distribution)
  • A serial connection between the Raspberry Pi and the Arduino (via USB)

Setting Up the Node

  1. Clone this repository to your ROS2 workspace:
cd ~/ros2_ws/src
git clone https://github.com/dark516/ros2_arduino_bridge

2.Build the package:

cd ~/ros2_ws
colcon build --packages-select ros2_arduino_bridge
  1. Source the workspace:
source ~/ros2_ws/install/setup.bash

Running the Node

  1. Connect the Arduino to the Raspberry Pi via USB
  2. Check the port of the connected arduino:
ls /dev| grep ttyACM
  1. Run the node with an explicit indication of the port received in the previous step
ros2 run ros2_arduino_bridge arduino_bridge /dev/ttyACM0

About

ROS2 Node for Communication with Arduino via Serial Port

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 88.6%
  • C++ 11.4%