This repository contains a template ROS2 node which implements the Arduino API for I2C (and soon GPIO, SPI and Serial) to enable using Ardunio C++ libraries in order to implement a ROS2 node for specific sensors or actuators.
-
On Github, select the
Use this template
button. This will begin creating a fork in your github account. -
Select a name for your fork, representing the node you are creating. In the examples below, I'll use
ros_firefly
, but this is your ROS node's name. -
Once it has been forked into your github account, navigate to your ROS2 workspace.
-
clone your fork into your workspace recursively -
git clone --recursive https://github.com/<your github>/ros_firefly
-
Update the following entries in your fork:
package.xml
- change<name>ros_wiring_template</name>
to<name>ros_firefly</name>
CMakeLists.txt
- changeproject(ros_wiring_template)
toproject(ros_firefly)
- Rename
ros_wiring_template.launch.py
toros_firefly.launch.py
- In
ros_firefly.launch.py
, change'ros_wiring_template'
to'ros_firefly'
Optionally
- in
main.cpp
changeclass I2CPublisher
toclass ROSFireFly
- in
main.cpp
changeNode("i2cpublisher")
toNode("FireFly")
- in
main.cpp
changestd::make_shared<I2CPublisher>()
tostd::make_shared<ROSFireFly>()
-
push your changes to your repository
git add *
thengit push