Dear sir, I use arduino yun and build rosserial-arduino example helloworld, when I complier and upload the code, it show warning: Sketch uses 11,968 bytes (41%) of program storage space. Maximum is 28,672 bytes. Global variables use 1,948 bytes (76%) of dynamic memory, leaving 612 bytes for local variables. Maximum is 2,560 bytes. Low memory available, stability problems may occur. Could this cause problem? How to reduce size? Helloword is simple: #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); }
The communication errors: john@uDocker:~$ rosrun rosserial_python serial_node.py _port:=/dev/ttyACM1 [INFO] [WallTime: 1461906854.574293] ROS Serial Python Node [INFO] [WallTime: 1461906854.580512] Connecting to /dev/ttyACM1 at 57600 baud [ERROR] [WallTime: 1461906871.685965] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino
I had follow http://wiki.ros.org/rosserial_arduino/Tutorials/Arduino%20IDE%20Setup and then follow http://answers.ros.org/question/196204/unable-to-sync-with-device-arduino-uno/ to get indigo source code, but the errors are the same.
Could somebody show me how to debug this?
- how to low the serial baud from 57600 to a low rate to make the link stable
- How to check my rosserial_python version and my Arduino version, such as "link software version mismatch such as hydro rosserial_python with groovy Arduino"
Thanks John
Originally posted by john_gao on ROS Answers with karma: 11 on 2016-04-29
Post score: 1
Original comments
Comment by alee on 2016-05-12:
Are you sure you have the correct permissions to your Arduino? Also, are you running at the same baud rate on the Arduino? There's likely a mismatch in baud rates between the serial node and the Arduino
Comment by john_gao on 2016-05-12:
Thank Alee, I think the baud rate is control by rosserial. I had add code set the serial port board in setting up. but the result is same.
Comment by alee on 2016-05-12:
Both can control baud. There's a baud rate on the arduino side and a baud rate on rosserial's side. Both need to match to communicate
Comment by john_gao on 2016-05-12:
Could you tell me the detail? From the sample code, this is hidden. If I want to reduce it, what should I do? Thanks
Comment by alee on 2016-05-12:
nh.getHardware()->setBaud(//some baud rate);
Make sure this value matches what you set for serial node.
Comment by john_gao on 2016-05-15:
Dear alee, it still does not work, even I drop both to 9600.
I follow in http://wiki.ros.org/rosserial_arduino/Tutorials/Arduino%20IDE%20Setup
I had done both 3.1.1 and 3.1.2, the only mistake is git clone which somebody see should use indigo, I had redo it but don't know how to clean old one,
Comment by alee on 2016-05-16:
What distro of ROS are you on? If you ran make_libraries with the wrong version of ROS, it might cause issues.
Comment by john_gao on 2016-05-17:
Thank alee, john@uDocker:~$ env | grep ROS
ROS_ROOT=/opt/ros/indigo/share/ros
ROS_PACKAGE_PATH=/opt/ros/indigo/share:/opt/ros/indigo/stacks
ROS_MASTER_URI=http://localhost:11311
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=indigo
ROS_ETC_DIR=/opt/ros/indigo/etc/ros
It is right.
Comment by alee on 2016-05-21:
It's hard to tell what's wrong without more information and the rosserial package doesnt have the best error statements...last thing I can think of is permissions to the port you're using
Comment by john_gao on 2016-05-23:
Thank Alee, I had set the port commission,so I can load the code to arduino Yun in no problem. The only things I think could be issue is I had followed the document but which install latest code, then I change to load the indigo part, I don't know any temp file or something is missing there,