I am trying to use an Arduino to connect two sensors to ROS Groovy on Ubuntu 12.04 but have problems to talk to it using rosserial. Since I have several sensors, I bought the Arduino Leonardo http://arduino.cc/en/Main/arduinoBoardLeonardo based on the ATmega32u4 since it has four interrupt pins that I need for my sensors.
The first problem was in ArduinoHardware.h
iostream = &Serial;
which I changed to
iostream = &Serial1;
as proposed here: https://github.com/ros-drivers/rosserial/issues/49
Now the HelloWorld.ino compiled and I could upload it to the Arduino. I started
rosrun rosserial_python serial_node.py /dev/ttyACM0
but only get this response:
[INFO] [WallTime: 1367338659.844329] ROS Serial Python Node
[INFO] [WallTime: 1367338659.858269] Connecting to /dev/ttyACM0 at 57600 baud
[ERROR] [WallTime: 1367338676.969867] Lost sync with device, restarting...
Has someone managed to use the Leonardo and can help me?
// update: I adapted by loop to:
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(led, LOW); // turn the LED on (HIGH is the voltage level)
state = !state;
delay(1000); // wait for a second
str_msg.data = hello;
chatter.publish( &str_msg );
The led (Pin 13) is blinks with a frequency of .5Hz (1s on 1s off). If (Iff) I start the rosserial_python, the TX-Led also flashes as the pin13-Led changes its state. Therefore there is at least some kind of communication, but no rostopic.
Post score: 2