Dobot Magician GetPose() python api cannot be used in loop


#1

Hi, I am trying to read the pose of Dobot Magician continuously with hhtTrigMode enabled, but the GetPose() is not returning all the points in the trajectory. There are so many duplicate points in the final array.

def rec(api):
    record = []
    delta = 0
    tstart = time.time()
    dType.SetHHTTrigMode(api,hhtTrigMode=1)
    dType.SetHHTTrigOutputEnabled(api, 1)
    while delta<10:
        pos = bot.get_ABSpose(api)
        tnow = time.time()
        delta = tnow - tstart
        record.append(pos)
    dType.SetHHTTrigOutputEnabled(api, 0)
    return record

This is the code I am using to record the waypoints while moving the Dobot Magician manually. I am using Ubuntu 16.04.


#2

Check this…Python interview questions