def groupLine(self, desPos, maxVel=None): """ Enable the group line interpolation motion from the current position to the target position in the Cartesian space. Note: max. velocity setting is not implement in python version API. TODO: Check c++ version API and update to accept the macVel. :param desPos: a List of 6 element [x, y, z, roll, pitch, yaw] :param maxVel: set the limit of max. velocity. input 0 to ignore the parameter :return: error code :rtype: int """ mask = 0 mask += GROUP_AXIS_MASK_X mask += GROUP_AXIS_MASK_Y mask += GROUP_AXIS_MASK_Z mask += GROUP_AXIS_MASK_A mask += GROUP_AXIS_MASK_B mask += GROUP_AXIS_MASK_C for i in range(len(desPos)): self.desPos_.pos[i] = desPos[i] if maxVel is None: maxVel = c_void_p() else: print("This Python version API do not accept maxVel argument and set to NULL as defualt.") maxVel = c_void_p() return self.__GroupLine__(self.id_, self.index_, c_int32(mask), self.desPos_, maxVel)
def tag_string(self, in_string): in_buffer = ctypes.create_string_buffer(in_string.encode('utf-8')) out_buffer = ctypes.pointer(ctypes.c_void_p()) self.__tag_string__(in_buffer, out_buffer) return ctypes.cast( out_buffer.contents, ctypes.POINTER(ctypes.c_char * (len(in_buffer) + 2)) ).contents[:].decode('utf-8').rstrip('\0')
def square_int_array(self, in_array): in_array_p = ctypes.cast( ctypes.pointer((ctypes.c_int16 * len(in_array))(*in_array)), ctypes.POINTER(ctypes.c_int16)) out_array_p = ctypes.pointer(ctypes.c_void_p()) self.__square_int_array__(in_array_p, out_array_p, ctypes.c_int16(len(in_array))) return ctypes.cast(out_array_p.contents, ctypes.POINTER(ctypes.c_int16 * len(in_array))).contents[:]