Hello,
I am looking to get the position of 3 dynamixels series x in real time.
Using the python SDK I am calling groupSyncRead however the read is extremely slow.
The dynamixels are connected with a U2D2, protocol version 2.0, latest firmware
The serial port is set to baud rate of 4000000
Each dynamixel ReturnDelayTime is set to 0us
Looping directly over groupSyncRead.txRxPacket() I am getting only 30 samples a second.
This is extremely low data rate given the baud rate, I was hoping to get at least 100 samples/ second.
Can someone please provide an example of how to properly read position values from multiple dynamixels simultaneously in python?
Thanks in advance
Here is the setup and read code
Code:
#Set up to read position
self.groupSyncReadPos = GroupSyncRead(port_handler, packet_handler, 132, 4)
.
.
.
#Inside a loop
dxl_comm_result = self.groupSyncReadPos.txRxPacket()
if dxl_comm_result != COMM_SUCCESS:
print("%s" % self.packetHandler.getTxRxResult(dxl_comm_result))
position = [self.groupSyncReadPos.getData(dyn.id, 132, 4) for dyn in self.dyns]
When I profile the code it appears 90% of time is spent in serialwin32.py Serial.read()
Bookmarks