How to use custom message arduino [SOLVED]
Hi guys,
I've been doing some novice work in arduino and ros and i would like to use a custom message already created as the official tutorial says. The custom package is in:
~/catkin_ws/src/pkg_prova1
and under its msg folder, we have the message file: Num.msg
This message works perfectly in a normal ROS node (not arduino) created by a C++ code. I can modify without issues all its fields and get the message published efficiently. Everything in the CMakeLists.txt and in the package.xml has been edited as the ROS tutorial suggests.
The problem is: how can my arduino use that custom message??
In order to make the arduino have it as a library, i've used:
rosrun rosserial_arduino make_libraries.py ~/sketchbook/libraries/ros_lib
Seems to have worked well despite that some packages like rtabmap, etc haven't been made. Anyway this isn't important.
Then, I open the Arduino IDE, open the HelloWorld example (just for testing the new message), and reference the message as a normal library in the very first line of the code:
#include <pkg_prova1/Num.h>
#include <ros.h>
#include <std_msgs/String.h>
ros::NodeHandle nh;
......(all the stuff that follows)
Unfortunately, it gives me the next compiling error:
HelloWorld.pde:6:28: fatal error: pkg_prova1/Num.h: No such file or directory
compilation terminated.
I guess either the new library that i have created is not well referenced so the IDE can find it or the make_libraries command is not what i should use.
Any ideas to do it? I would appreciate a detailed answer as my ROS knowledge is still some fuzzy.
Correct me if i have a wrong understanding of anything.
Thanks in advance!