ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can try generating custom headers for arduino and compiling&uploading the arduino code separately. These packages should probably be installed for that (maybe some are optional):

sudo apt install ros-noetic-rosserial-arduino ros-noetic-rosserial-python ros-noetic-rosserial-client ros-noetic-rosserial

Build the headers for arduino:

# make sure that all messages have been built in the workspace
roscd
catkin build
source setup.bash

# cd ~/<sketchbook>/libraries
cd ~/Arduino/libraries

# remove old versions of the compiled headers (including installed from GUI)
# or back them up just in case (but make sure they are not under the ~/<sketchbook>/libraries)
rm -rf ros_lib
rm -rf Rosserial_Arduino_Library

# compile common ros headers
rosrun rosserial_arduino make_libraries.py .

# compile custom headers
rosrun rosserial_client make_libraries .

After his you should have a ~/<sketchbook>/libraries/ros_lib directory with ros.h header, some other common headers and directories, as well as directories with your custom message headers.

Compiling and uploading code to the arduino can then be done either via the Arduino IDE or using arduino-cli.