ros arduino "hello world"
I am trying to run the hello world tutorial and when I type "tma-0@tma-0-laptop:~$ rosrun rosserial_python serial_node.py /dev/ttyACM0" I keep getting the following error messages:
[INFO] [WallTime: 1321395246.850533] ROS Serial Python Node [INFO] [WallTime: 1321395246.857889] Connected on /dev/ttyACM0 at 57600 baud [ERROR] [WallTime: 1321395249.783413] Creation of publisher failed: unpack requires a string argument of length 4 [ERROR] [WallTime: 1321395250.786880] Tried to publish before configured, topic id 125
I have run roswtf and checked to make sure that all of the dependencies for rosserial_arduino have been installed.
My arduino code is the same as the example
/*
* rosserial Publisher Example
* Prints "hello world!"
*/
#include <ros.h>
#include <std_msgs/String.h>
ros::NodeHandle nh;
std_msgs::String str_msg;
ros::Publisher chatter("chatter", &str_msg);
char hello[13] = "hello world!";
void setup()
{
nh.initNode();
nh.advertise(chatter);
}
void loop()
{
str_msg.data = hello;
chatter.publish( &str_msg );
nh.spinOnce();
delay(1000);
}
enter code here
Also, I am running Ubuntu 10.04 and I am using an Arduino Mega 2560. I have tried going through the FAQ but am really stuck, any help would be greatly appreciated.