Rosserial: slow publishing Twist commands to arduino

asked 2016-05-29 12:09:43 -0500

h3ct0r gravatar image

Hi,

I'm developing a Rosserial bridge with an arduino mega 256 to read information from a IMU and send commands to 2 servos. I'm setting the serial baud to 115200 to increase the speed.

The readings from the IMU are fast, but when I publish some Twist command the arduino stops sending the IMU messages and it takes at least 3-5 seconds to receive and process the servo command.

Even using this code it waits at least 4 seconds to execute the movement:

$ rostopic pub -1 /cmd_vel geometry_msgs/Twist -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'

Is this a normal behaviour? How can I make the Arduino to process the Twist messages faster?

The code i'm using is on: http://pastebin.com/9q3iqk1W (If needed I can post it here also)

edit retag flag offensive close merge delete

Comments

Hi, i also have the same trouble, but with a single publishing for LED toggle, do you have any solution for that?

cadbabcd gravatar image cadbabcd  ( 2019-11-11 04:13:08 -0500 )edit

Sorry for the late response. In the end, the problem was my Arduino. I changed the device, and the communication started to work fine after it. Maybe it was related to the bad quality of Arduino knockoffs!

h3ct0r gravatar image h3ct0r  ( 2020-01-16 12:34:47 -0500 )edit