Search is not available for this dataset
text
stringlengths
75
104k
def simxSetJointForce(clientID, jointHandle, force, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' return c_SetJointForce(clientID, jointHandle, force, operationMode)
def simxReadForceSensor(clientID, forceSensorHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' state = ct.c_ubyte() forceVector = (ct.c_float*3)() torqueVector = (ct.c_float*3)() ret = c_ReadForceSensor(clientID, forceSenso...
def simxReadVisionSensor(clientID, sensorHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' detectionState = ct.c_ubyte() auxValues = ct.POINTER(ct.c_float)() auxValuesCount = ct.POINTER(ct.c_int)() ret = c_ReadVisionSe...
def simxGetObjectHandle(clientID, objectName, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' handle = ct.c_int() if (sys.version_info[0] == 3) and (type(objectName) is str): objectName=objectName.encode('utf-8') return c_GetO...
def simxGetVisionSensorImage(clientID, sensorHandle, options, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' resolution = (ct.c_int*2)() c_image = ct.POINTER(ct.c_byte)() bytesPerPixel = 3 if (options and 1) != 0: bytes...
def simxSetVisionSensorImage(clientID, sensorHandle, image, options, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' size = len(image) image_bytes = (ct.c_byte*size)(*image) return c_SetVisionSensorImage(clientID, sensorHandle, image...
def simxGetVisionSensorDepthBuffer(clientID, sensorHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' c_buffer = ct.POINTER(ct.c_float)() resolution = (ct.c_int*2)() ret = c_GetVisionSensorDepthBuffer(clientID, sensorHandle, res...
def simxGetObjectChild(clientID, parentObjectHandle, childIndex, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' childObjectHandle = ct.c_int() return c_GetObjectChild(clientID, parentObjectHandle, childIndex, ct.byref(childObjectHandle),...
def simxGetObjectParent(clientID, childObjectHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' parentObjectHandle = ct.c_int() return c_GetObjectParent(clientID, childObjectHandle, ct.byref(parentObjectHandle), operationMode), pare...
def simxReadProximitySensor(clientID, sensorHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' detectionState = ct.c_ubyte() detectedObjectHandle = ct.c_int() detectedPoint = (ct.c_float*3)() detectedSurfaceNormalVector = (...
def simxLoadModel(clientID, modelPathAndName, options, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' baseHandle = ct.c_int() if (sys.version_info[0] == 3) and (type(modelPathAndName) is str): modelPathAndName=modelPathAndName.en...
def simxLoadUI(clientID, uiPathAndName, options, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' count = ct.c_int() uiHandles = ct.POINTER(ct.c_int)() if (sys.version_info[0] == 3) and (type(uiPathAndName) is str): uiPathAndN...
def simxLoadScene(clientID, scenePathAndName, options, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if (sys.version_info[0] == 3) and (type(scenePathAndName) is str): scenePathAndName=scenePathAndName.encode('utf-8') return c_...
def simxGetUIHandle(clientID, uiName, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' handle = ct.c_int() if (sys.version_info[0] == 3) and (type(uiName) is str): uiName=uiName.encode('utf-8') return c_GetUIHandle(clientID, u...
def simxGetUISlider(clientID, uiHandle, uiButtonID, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' position = ct.c_int() return c_GetUISlider(clientID, uiHandle, uiButtonID, ct.byref(position), operationMode), position.value
def simxSetUISlider(clientID, uiHandle, uiButtonID, position, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' return c_SetUISlider(clientID, uiHandle, uiButtonID, position, operationMode)
def simxGetUIEventButton(clientID, uiHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' uiEventButtonID = ct.c_int() auxValues = (ct.c_int*2)() ret = c_GetUIEventButton(clientID, uiHandle, ct.byref(uiEventButtonID), auxValues, o...
def simxGetUIButtonProperty(clientID, uiHandle, uiButtonID, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' prop = ct.c_int() return c_GetUIButtonProperty(clientID, uiHandle, uiButtonID, ct.byref(prop), operationMode), prop.value
def simxSetUIButtonProperty(clientID, uiHandle, uiButtonID, prop, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' return c_SetUIButtonProperty(clientID, uiHandle, uiButtonID, prop, operationMode)
def simxAddStatusbarMessage(clientID, message, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if (sys.version_info[0] == 3) and (type(message) is str): message=message.encode('utf-8') return c_AddStatusbarMessage(clientID, messa...
def simxAuxiliaryConsoleOpen(clientID, title, maxLines, mode, position, size, textColor, backgroundColor, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' consoleHandle = ct.c_int() if (sys.version_info[0] == 3) and (type(title) is str): ...
def simxAuxiliaryConsolePrint(clientID, consoleHandle, txt, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if (sys.version_info[0] == 3) and (type(txt) is str): txt=txt.encode('utf-8') return c_AuxiliaryConsolePrint(clientID, co...
def simxAuxiliaryConsoleShow(clientID, consoleHandle, showState, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' return c_AuxiliaryConsoleShow(clientID, consoleHandle, showState, operationMode)
def simxGetObjectOrientation(clientID, objectHandle, relativeToObjectHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' eulerAngles = (ct.c_float*3)() ret = c_GetObjectOrientation(clientID, objectHandle, relativeToObjectHandle, euler...
def simxGetObjectPosition(clientID, objectHandle, relativeToObjectHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' position = (ct.c_float*3)() ret = c_GetObjectPosition(clientID, objectHandle, relativeToObjectHandle, position, oper...
def simxSetObjectOrientation(clientID, objectHandle, relativeToObjectHandle, eulerAngles, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' angles = (ct.c_float*3)(*eulerAngles) return c_SetObjectOrientation(clientID, objectHandle, relativ...
def simxSetObjectPosition(clientID, objectHandle, relativeToObjectHandle, position, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' c_position = (ct.c_float*3)(*position) return c_SetObjectPosition(clientID, objectHandle, relativeToObjec...
def simxSetObjectParent(clientID, objectHandle, parentObject, keepInPlace, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' return c_SetObjectParent(clientID, objectHandle, parentObject, keepInPlace, operationMode)
def simxSetUIButtonLabel(clientID, uiHandle, uiButtonID, upStateLabel, downStateLabel, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if sys.version_info[0] == 3: if type(upStateLabel) is str: upStateLabel=upStateLabel.e...
def simxGetLastErrors(clientID, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' errors =[] errorCnt = ct.c_int() errorStrings = ct.POINTER(ct.c_char)() ret = c_GetLastErrors(clientID, ct.byref(errorCnt), ct.byref(errorStrings), op...
def simxGetArrayParameter(clientID, paramIdentifier, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' paramValues = (ct.c_float*3)() ret = c_GetArrayParameter(clientID, paramIdentifier, paramValues, operationMode) arr = [] for i in...
def simxSetArrayParameter(clientID, paramIdentifier, paramValues, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' c_paramValues = (ct.c_float*3)(*paramValues) return c_SetArrayParameter(clientID, paramIdentifier, c_paramValues, operation...
def simxGetBooleanParameter(clientID, paramIdentifier, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' paramValue = ct.c_ubyte() return c_GetBooleanParameter(clientID, paramIdentifier, ct.byref(paramValue), operationMode), bool(paramValu...
def simxSetBooleanParameter(clientID, paramIdentifier, paramValue, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' return c_SetBooleanParameter(clientID, paramIdentifier, paramValue, operationMode)
def simxGetIntegerParameter(clientID, paramIdentifier, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' paramValue = ct.c_int() return c_GetIntegerParameter(clientID, paramIdentifier, ct.byref(paramValue), operationMode), paramValue.value
def simxSetIntegerParameter(clientID, paramIdentifier, paramValue, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' return c_SetIntegerParameter(clientID, paramIdentifier, paramValue, operationMode)
def simxGetFloatingParameter(clientID, paramIdentifier, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' paramValue = ct.c_float() return c_GetFloatingParameter(clientID, paramIdentifier, ct.byref(paramValue), operationMode), paramValue.v...
def simxSetFloatingParameter(clientID, paramIdentifier, paramValue, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' return c_SetFloatingParameter(clientID, paramIdentifier, paramValue, operationMode)
def simxGetStringParameter(clientID, paramIdentifier, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' paramValue = ct.POINTER(ct.c_char)() ret = c_GetStringParameter(clientID, paramIdentifier, ct.byref(paramValue), operationMode) ...
def simxGetCollisionHandle(clientID, collisionObjectName, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' handle = ct.c_int() if (sys.version_info[0] == 3) and (type(collisionObjectName) is str): collisionObjectName=collisionObje...
def simxGetCollectionHandle(clientID, collectionName, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' handle = ct.c_int() if (sys.version_info[0] == 3) and (type(collectionName) is str): collectionName=collectionName.encode('utf-...
def simxGetDistanceHandle(clientID, distanceObjectName, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' handle = ct.c_int() if (sys.version_info[0] == 3) and (type(distanceObjectName) is str): distanceObjectName=distanceObjectNam...
def simxReadCollision(clientID, collisionObjectHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' collisionState = ct.c_ubyte() return c_ReadCollision(clientID, collisionObjectHandle, ct.byref(collisionState), operationMode), bool(co...
def simxReadDistance(clientID, distanceObjectHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' minimumDistance = ct.c_float() return c_ReadDistance(clientID, distanceObjectHandle, ct.byref(minimumDistance), operationMode), minimumD...
def simxGetObjects(clientID, objectType, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' objectCount = ct.c_int() objectHandles = ct.POINTER(ct.c_int)() ret = c_GetObjects(clientID, objectType, ct.byref(objectCount), ct.byref(object...
def simxDisplayDialog(clientID, titleText, mainText, dialogType, initialText, titleColors, dialogColors, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if titleColors != None: c_titleColors = (ct.c_float*6)(*titleColors) else: ...
def simxGetDialogInput(clientID, dialogHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' inputText = ct.POINTER(ct.c_char)() ret = c_GetDialogInput(clientID, dialogHandle, ct.byref(inputText), operationMode) a = bytearray()...
def simxGetDialogResult(clientID, dialogHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' result = ct.c_int() return c_GetDialogResult(clientID, dialogHandle, ct.byref(result), operationMode), result.value
def simxCopyPasteObjects(clientID, objectHandles, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' c_objectHandles = (ct.c_int*len(objectHandles))(*objectHandles) c_objectHandles = ct.cast(c_objectHandles,ct.POINTER(ct.c_int)) # IronPytho...
def simxGetObjectSelection(clientID, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' objectCount = ct.c_int() objectHandles = ct.POINTER(ct.c_int)() ret = c_GetObjectSelection(clientID, ct.byref(objectHandles), ct.byref(objectCount)...
def simxSetObjectSelection(clientID, objectHandles, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' c_objectHandles = (ct.c_int*len(objectHandles))(*objectHandles) return c_SetObjectSelection(clientID, c_objectHandles, len(objectHandles...
def simxClearFloatSignal(clientID, signalName, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if (sys.version_info[0] == 3) and (type(signalName) is str): signalName=signalName.encode('utf-8') return c_ClearFloatSignal(clientID,...
def simxClearIntegerSignal(clientID, signalName, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if (sys.version_info[0] == 3) and (type(signalName) is str): signalName=signalName.encode('utf-8') return c_ClearIntegerSignal(clien...
def simxClearStringSignal(clientID, signalName, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if (sys.version_info[0] == 3) and (type(signalName) is str): signalName=signalName.encode('utf-8') return c_ClearStringSignal(clientI...
def simxGetFloatSignal(clientID, signalName, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' signalValue = ct.c_float() if (sys.version_info[0] == 3) and (type(signalName) is str): signalName=signalName.encode('utf-8') return...
def simxGetIntegerSignal(clientID, signalName, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' signalValue = ct.c_int() if (sys.version_info[0] == 3) and (type(signalName) is str): signalName=signalName.encode('utf-8') return...
def simxReadStringStream(clientID, signalName, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' signalLength = ct.c_int(); signalValue = ct.POINTER(ct.c_ubyte)() if (sys.version_info[0] == 3) and (type(signalName) is str): sig...
def simxSetFloatSignal(clientID, signalName, signalValue, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if (sys.version_info[0] == 3) and (type(signalName) is str): signalName=signalName.encode('utf-8') return c_SetFloatSignal(...
def simxSetIntegerSignal(clientID, signalName, signalValue, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if (sys.version_info[0] == 3) and (type(signalName) is str): signalName=signalName.encode('utf-8') return c_SetIntegerSig...
def simxSetStringSignal(clientID, signalName, signalValue, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' sigV=signalValue if sys.version_info[0] == 3: if type(signalName) is str: signalName=signalName.encode('utf-8'...
def simxGetObjectFloatParameter(clientID, objectHandle, parameterID, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' parameterValue = ct.c_float() return c_GetObjectFloatParameter(clientID, objectHandle, parameterID, ct.byref(paramet...
def simxSetObjectFloatParameter(clientID, objectHandle, parameterID, parameterValue, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' return c_SetObjectFloatParameter(clientID, objectHandle, parameterID, parameterValue, operationMode)
def simxGetObjectIntParameter(clientID, objectHandle, parameterID, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' parameterValue = ct.c_int() return c_GetObjectIntParameter(clientID, objectHandle, parameterID, ct.byref(parameterValue),...
def simxSetObjectIntParameter(clientID, objectHandle, parameterID, parameterValue, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' return c_SetObjectIntParameter(clientID, objectHandle, parameterID, parameterValue, operationMode)
def simxGetModelProperty(clientID, objectHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' prop = ct.c_int() return c_GetModelProperty(clientID, objectHandle, ct.byref(prop), operationMode), prop.value
def simxSetModelProperty(clientID, objectHandle, prop, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' return c_SetModelProperty(clientID, objectHandle, prop, operationMode)
def simxStart(connectionAddress, connectionPort, waitUntilConnected, doNotReconnectOnceDisconnected, timeOutInMs, commThreadCycleInMs): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if (sys.version_info[0] == 3) and (type(connectionAddress) is str): ...
def simxGetPingTime(clientID): ''' Please have a look at the function description/documentation in the V-REP user manual ''' pingTime = ct.c_int() return c_GetPingTime(clientID, ct.byref(pingTime)), pingTime.value
def simxGetInMessageInfo(clientID, infoType): ''' Please have a look at the function description/documentation in the V-REP user manual ''' info = ct.c_int() return c_GetInMessageInfo(clientID, infoType, ct.byref(info)), info.value
def simxGetOutMessageInfo(clientID, infoType): ''' Please have a look at the function description/documentation in the V-REP user manual ''' info = ct.c_int() return c_GetOutMessageInfo(clientID, infoType, ct.byref(info)), info.value
def simxTransferFile(clientID, filePathAndName, fileName_serverSide, timeOut, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if (sys.version_info[0] == 3) and (type(filePathAndName) is str): filePathAndName=filePathAndName.encode('u...
def simxEraseFile(clientID, fileName_serverSide, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if (sys.version_info[0] == 3) and (type(fileName_serverSide) is str): fileName_serverSide=fileName_serverSide.encode('utf-8') return...
def simxCreateDummy(clientID, size, color, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' handle = ct.c_int() if color != None: c_color = (ct.c_ubyte*12)(*color) else: c_color = None return c_CreateDummy(clientID...
def simxQuery(clientID, signalName, signalValue, retSignalName, timeOutInMs): ''' Please have a look at the function description/documentation in the V-REP user manual ''' retSignalLength = ct.c_int(); retSignalValue = ct.POINTER(ct.c_ubyte)() sigV=signalValue if sys.version_info[0] == 3: ...
def simxGetObjectGroupData(clientID, objectType, dataType, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' handles =[] intData =[] floatData =[] stringData =[] handlesC = ct.c_int() handlesP = ct.POINTER(ct.c_int)() i...
def simxCallScriptFunction(clientID, scriptDescription, options, functionName, inputInts, inputFloats, inputStrings, inputBuffer, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' inputBufferV=inputBuffer if sys.version_info[0] == 3: ...
def simxGetObjectVelocity(clientID, objectHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' linearVel = (ct.c_float*3)() angularVel = (ct.c_float*3)() ret = c_GetObjectVelocity(clientID, objectHandle, linearVel, angularVel, ope...
def simxPackInts(intList): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if sys.version_info[0] == 3: s=bytes() for i in range(len(intList)): s=s+struct.pack('<i',intList[i]) s=bytearray(s) else: s='' ...
def simxUnpackInts(intsPackedInString): ''' Please have a look at the function description/documentation in the V-REP user manual ''' b=[] for i in range(int(len(intsPackedInString)/4)): b.append(struct.unpack('<i',intsPackedInString[4*i:4*(i+1)])[0]) return b
def simxPackFloats(floatList): ''' Please have a look at the function description/documentation in the V-REP user manual ''' if sys.version_info[0] == 3: s=bytes() for i in range(len(floatList)): s=s+struct.pack('<f',floatList[i]) s=bytearray(s) else: s='...
def simxUnpackFloats(floatsPackedInString): ''' Please have a look at the function description/documentation in the V-REP user manual ''' b=[] for i in range(int(len(floatsPackedInString)/4)): b.append(struct.unpack('<f',floatsPackedInString[4*i:4*(i+1)])[0]) return b
def setup(self): """ Starts all the synchronization loops. """ [c.start() for c in self.controllers] [c.wait_to_start() for c in self.controllers]
def from_poppy_creature(cls, poppy, motors, passiv, tip, reversed_motors=[]): """ Creates an kinematic chain from motors of a Poppy Creature. :param poppy: PoppyCreature used :param list motors: list of all motors that composed the kinematic chain ...
def end_effector(self): """ Returns the cartesian position of the end of the chain (in meters). """ angles = self.convert_to_ik_angles(self.joints_position) return self.forward_kinematics(angles)[:3, 3]
def goto(self, position, duration, wait=False, accurate=False): """ Goes to a given cartesian position. :param list position: [x, y, z] representing the target position (in meters) :param float duration: move duration :param bool wait: whether to wait for the end of the move...
def _goto(self, pose, duration, wait, accurate): """ Goes to a given cartesian pose. :param matrix pose: homogeneous matrix representing the target position :param float duration: move duration :param bool wait: whether to wait for the end of the move :param bool...
def convert_to_ik_angles(self, joints): """ Convert from poppy representation to IKPY internal representation. """ if len(joints) != len(self.motors): raise ValueError('Incompatible data, len(joints) should be {}!'.format(len(self.motors))) raw_joints = [(j + m.offset) * (1 if m.dir...
def convert_from_ik_angles(self, joints): """ Convert from IKPY internal representation to poppy representation. """ if len(joints) != len(self.motors) + 2: raise ValueError('Incompatible data, len(joints) should be {}!'.format(len(self.motors) + 2)) joints = [rad2deg(j) for j in jo...
def factory_reset(self, ids, except_ids=False, except_baudrate_and_ids=False): """ Reset all motors on the bus to their factory default settings. """ mode = (0x02 if except_baudrate_and_ids else 0x01 if except_ids else 0xFF) for id in ids: try: self....
def start(self): """ Start or restart (the :meth:`~pypot.primitive.primitive.Primitive.stop` method will automatically be called) the primitive. """ if not self.robot._primitive_manager.running: raise RuntimeError('Cannot run a primitive when the sync is stopped!') StoppableThread.s...
def stop(self, wait=True): """ Requests the primitive to stop. """ logger.info("Primitive %s stopped.", self) StoppableThread.stop(self, wait)
def get_mockup_motor(self, motor): """ Gets the equivalent :class:`~pypot.primitive.primitive.MockupMotor`. """ return next((m for m in self.robot.motors if m.name == motor.name), None)
def recent_update_frequencies(self): """ Returns the 10 most recent update frequencies. The given frequencies are computed as short-term frequencies! The 0th element of the list corresponds to the most recent frequency. """ return list(reversed([(1.0 / p) for p in numpy.diff(sel...
def goto_position(self, position, duration, control=None, wait=False): """ Automatically sets the goal position and the moving speed to reach the desired position within the duration. """ if control is None: control = self.goto_behavior if control == 'minjerk': goto_min...
def save(self, file): """ Saves the :class:`~pypot.primitive.move.Move` to a json file. .. note:: The format used to store the :class:`~pypot.primitive.move.Move` is extremely verbose and should be obviously optimized for long moves. """ d = { 'framerate': self.framerate, ...
def create(cls, d): """ Create a :class:`~pypot.primitive.move.Move` from a dictionary. """ move = cls(d['framerate']) move._timed_positions.update(d['positions']) return move
def load(cls, file): """ Loads a :class:`~pypot.primitive.move.Move` from a json file. """ d = json.load(file) return cls.create(d)
def loads(cls, str): """ Loads a :class:`~pypot.primitive.move.Move` from a json string. """ d = json.loads(str) return cls.create(d)
def add_tracked_motors(self, tracked_motors): """Add new motors to the recording""" new_mockup_motors = map(self.get_mockup_motor, tracked_motors) self.tracked_motors = list(set(self.tracked_motors + new_mockup_motors))
def update(self): """ Combined at a predefined frequency the request orders and affect them to the real motors. """ with self.syncing: for m in self._motors: to_set = defaultdict(list) for p in self._prim: for key, val in getattr(p.robot, ...