Results 1 to 4 of 4

Thread: Python dynamixelSDK very slow read

  1. Python dynamixelSDK very slow read


    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

    #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(, 132, 4) for dyn in self.dyns]
    When I profile the code it appears 90% of time is spent in

  2. #2

    Re: Python dynamixelSDK very slow read

    It's quite likely that the problem is some combination of the Python serial implementation, and the U2D2 device. Request/response turn-around time will just take a while, as far as I can tell.
    I have found that, for high performance serial, trying to do it from a high-level system (like Windows or MacOS) just won't work.
    Get yourself a microcontroller with the right serial hardware attachment, and program it at the low level, and then communicate higher-level commands to your PC (and/or use some kind of streaming protocol over USB rather than request/response.)

  3. #3

    Re: Python dynamixelSDK very slow read

    Sorry, I am not a python person...

    My only time I experimented with Python was on a ROS setup, using something like an RPI... And at least at that time ROS with PySerial really had issues. Some simple node would eat up like most of one core of the RPI, doing almost nothing. So I would try to replace with similar code in C++.

    In cases like this it generally helps if you specify additional information, like what type of processor the U2D2 is plugged into. Windows, Mac, Ubuntu X86 or ARM...

    Good Luck. I assume you also asked up on the Robotis Forum?

  4. #4

    Re: Python dynamixelSDK very slow read

    How about checking USB latency setting?As i know, the default setting is 16 [ms].

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 02-28-2020, 11:39 PM
  2. Question(s) DynamixelSDK: printRxPacketError doesn't print the error?
    By vegzh in forum DYNAMIXEL & Robot Actuators
    Replies: 0
    Last Post: 07-21-2017, 08:12 PM
  3. DynamixelSDK for USB2AX
    By Xevel in forum Software and Programming
    Replies: 1
    Last Post: 02-25-2014, 03:02 AM
  4. Question(s) How do I slow down the motors?
    By ilo_oli in forum Software and Programming
    Replies: 0
    Last Post: 11-01-2011, 06:45 PM
  5. Question(s) As Slow As Possible. Seriously.
    By draikani in forum DYNAMIXEL & Robot Actuators
    Replies: 9
    Last Post: 04-18-2010, 02:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts