Rosserial: slow publishing Twist commands to arduino
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)
Hi, i also have the same trouble, but with a single publishing for LED toggle, do you have any solution for that?
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!