Delay when using two roboclaws over usb
Posted: Wed Oct 02, 2019 5:52 am
Hello,
I have connected 2 roboclaws in order to control 4 motors.
I have enabled Relay mode on the first Roboclaw that is connected to the USB port of my PC.
I have also changed its Packet Serial Address, 128 on the first one, 129 on the second one.
Last, I have connect S1 from one Roboclaw to S2 on the other and vis-versa.
The problem is that I am experiencing delays when sending commands over a joystick.
My python code looks like the following:
##################
rc = Roboclaw("/dev/ttyACM0", 115200)
rc.Open()
address = 0x80
address2 = 0x81
if data.axes[1] >= 0:
rc.ForwardM1(address, int(data.axes[1]*32))
rc.ForwardM1(address2,int(data.axes[1]*32))
else:
rc.BackwardM1(address,-int(data.axes[1]*32))
rc.BackwardM1(address2,-int(data.axes[1]*32))
##################
It is straightforward. data.axes are the joystick values.
I am experiencing something like command buffering. the commands are not executed on time but after 1 or 2 seconds etc, one after the other.
Do you have any suggestions ?
Thank you in advance for your help.
Athanasios Mastrogeorgiou
I have connected 2 roboclaws in order to control 4 motors.
I have enabled Relay mode on the first Roboclaw that is connected to the USB port of my PC.
I have also changed its Packet Serial Address, 128 on the first one, 129 on the second one.
Last, I have connect S1 from one Roboclaw to S2 on the other and vis-versa.
The problem is that I am experiencing delays when sending commands over a joystick.
My python code looks like the following:
##################
rc = Roboclaw("/dev/ttyACM0", 115200)
rc.Open()
address = 0x80
address2 = 0x81
if data.axes[1] >= 0:
rc.ForwardM1(address, int(data.axes[1]*32))
rc.ForwardM1(address2,int(data.axes[1]*32))
else:
rc.BackwardM1(address,-int(data.axes[1]*32))
rc.BackwardM1(address2,-int(data.axes[1]*32))
##################
It is straightforward. data.axes are the joystick values.
I am experiencing something like command buffering. the commands are not executed on time but after 1 or 2 seconds etc, one after the other.
Do you have any suggestions ?
Thank you in advance for your help.
Athanasios Mastrogeorgiou