Arduino IDE can't find message header
Hey, I'm new to ROS and trying to have a led blink at will with my Arduino from my computer using a message, the future goal being to control several ones from my terminal. I am using ROS lunar and the rosserial_arduino package.
I wrote my publisher, subscriber and message, ran the package from a terminal to another as a test and it worked perfectly. Then I put the subscriber code in a new Arduino sketch and adapted it. However, when I try to compile it, I get the following error:
/home/eric/Arduino/blink_one_ros/blink_one_ros.ino:2:30: fatal error: blink_one/Number.h: No such file or directory
#include <blink_one/Number.h>
^
My include being as follows:
#include <ros.h>
#include <blink_one/Number.h>
I already looked into this answer and several others, but I am afraid that it would be an error from my package so I want to be sure before re-installing ROS.
I did run the often advised:
rm -rf ros_lib/
rosrun rosserial_arduino make_libraries.py <my_path>
And indeed, I can find my message header in my ros_lib/blink_one . Yet it still does not seem to be recognized.
If anyone knows a solution or has some hints, I'd appreciate it!
Thanks!
is the blink_one msg is written by use? because by default there is no such msg
I don't quite understand the question, sorry. I made it so that the publisher node running in my PC publishes a message into a topic that will be read by the subscriber node, which will be loaded in the Arduino. The message data is an integer, that I want to input in my terminal.
what is the msg type of your topic? please check using
rostopic info /topic name
. I just want to know what is<blink_one/Number.h>
. please let me know the msg type(std_msgs/Int64 or ?) of topic.It should be an int16 but when I type this, I get
Type: blink_one/Number
Then why are you including
<blink_one/Number.h
. It should be#include std_msgs/Int16.h
Sorry, I slightly modified my previous answer after checking. About the use of the include, it's because I call this function
void chatterCallback(const blink_one::Number msg) { code... }
.How you have created
blink_one/Number.h
. Make sure it is available inArduino/libraries/ros_lib/blink_one/Number.h
. refre this linkI created the header by first creating the
.msg
file, then adding the required lines in the CMakeLists as shown in the msg and srv tutorials and finallycatkin_make
. Yes, the header is in theros_lib/blink_one
folder.