Rosserial problem with std_msgs on Arduino
Hello,
I am trying to connect ROS with Arduino using a simple subscriber and publisher program to blink a LED on an Arduino but I am getting an error when including the std_msgs/Int8.h library on arduino. It says that there is no such file or directory but I have already followed all the steps on the ROS tutorial and the library is already in my ros_lib inside arduino.
I have also tried including the Rosserial library from the arduino IDE but I still get the same error.
Does anyone know how to fix this or if I am doing something wrong?
Pablo.
Arduino code:
include <ros.h>
include <stg_msgs int8.h="">
ros::NodeHandle nh;
void messageCb(const std_msgs::Int8& toggle_msg){ if(toggle_msg.data==4){ digitalWrite(13, HIGH-digitalRead(13)); } }
ros::Subscriber<std_msgs::int8> sub("chatter", messageCb);
void setup() { pinMode(13, OUTPUT); nh.intNode() nh.subscribe(sub);
}
void loop() { nh.spinOnce(); delay(500);
}
Arduino error:
est:2:10: fatal error: stg_msgs/Int8.h: No such file or directory #include <stg_msgs int8.h=""> ^~~~~~~~~~~~~~~~~ compilation terminated. exit status 1 stg_msgs/Int8.h: No such file or directory
Can you add the code as preformatted text? this is hard to read. It's also missing the # before include. And why do you have ' =""' ' at the end of your include? And did you look at the tutorial: http://wiki.ros.org/rosserial_arduino... ?