ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

problem of Firmware commands in ros_arduino_bridge package

asked 2016-05-27 03:37:06 -0500

Fighting_bird gravatar image

I git clone the ros_arduino_bridge package, and modified it according to README file and my hardware equipment. And when I test the firmware commands with my arduino mega 2560, it outputs nothing whatever I enter any command, but the LED of RX blinks. I'm very very confused, who can help me?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-05-27 08:22:53 -0500

Pi Robot gravatar image

updated 2016-05-27 11:51:11 -0500

The baud rate set in the Serial Monitor of the Arduino IDE needs to match the baud rate set in the ROSArduinoBridge firmware which is 57600 by default. This is actually explained in the documentation which I quote below:

NOTE: Before trying these commands, set the Serial Monitor baudrate to 57600 and the line terminator to "Carriage return" or "Both NL & CR" using the two pulldown menus on the lower right of the Serial Monitor window.

EDIT: Please confirm the following three steps:

(1) In the ROSArduinoBridge.ino file, make sure you have the following #define:

#define BAUDRATE     57600

(2) Compile and upload the sketch to your Arduino.

(3) In the Arduino IDE, open the Serial Monitor and set its baud rate to 57600 and the line ending to Carriage Return.

Then try the firmware commands.

Also, you do not specify the hardware you are using to run ROS. Are you using a serial port that is capable of baud rates greater than 9600?

edit flag offensive delete link more

Comments

Thank you for your help very much. I understand what you mean, but as what I said in my question--it output nothing if I set baud rate to 57600. But when I set it ro 9600, it just works fine. So I don't know why and I am very eager for your explanation.

Fighting_bird gravatar image Fighting_bird  ( 2016-05-27 10:15:16 -0500 )edit

Please see the Edit to my answer above.

Pi Robot gravatar image Pi Robot  ( 2016-05-27 11:51:34 -0500 )edit

Thank you for your answer very much. I followed your step, but it output nothing. And I debug the program by making it output what it has read to serial monitor, and I get some gibberish characters. BTY, I run ROS on my laptop computer, and I think the baud rate of its serial port can get to 57600.

Fighting_bird gravatar image Fighting_bird  ( 2016-05-28 05:32:18 -0500 )edit

That is very strange. Can you try using a different sketch on your Arduino such as the Example/AnalogReadSerial sketch and see if you get the same problem. I can reproduce your results with the AnalogReadSerial sketch if I make the sketch baud rate different than the Serial Monitor baud rate.

Pi Robot gravatar image Pi Robot  ( 2016-05-28 07:56:52 -0500 )edit
0

answered 2016-05-27 04:38:06 -0500

Fighting_bird gravatar image

I solved this problem just now. I modified the value of baudrate to 9600 from 57600, and it output what i need. But I don't why I can't set the baudrate to 57600 or higher.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-05-27 03:37:06 -0500

Seen: 199 times

Last updated: May 27 '16