- 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.
- ROS2 Rolling (or your desired ROS2 distribution)
- A serial connection between the Raspberry Pi and the Arduino (via USB)
- Clone this repository to your ROS2 workspace:
cd ~/ros2_ws/src
git clone https://github.com/dark516/ros2_arduino_bridge2.Build the package:
cd ~/ros2_ws
colcon build --packages-select ros2_arduino_bridge- Source the workspace:
source ~/ros2_ws/install/setup.bash- Connect the Arduino to the Raspberry Pi via USB
- Check the port of the connected arduino:
ls /dev| grep ttyACM- Run the node with an explicit indication of the port received in the previous step
ros2 run ros2_arduino_bridge arduino_bridge /dev/ttyACM0