def USBCamSwitchCamera(camera): r"""Switch currently streaming cam Parameters --------- camera : int Number of camera from /dev/video* """ if not is_strict_int(camera): raise InvalidParametersException() USBCam.switchCamera(camera)
def setWheelSpeed(wheel, speed): r"""Sets speed of a specified wheel of rover. Parameters ---------- wheel : int Wheel selector. speed : int Target speed in scale 1-100. Returns ------- status_code : int Returns 0, because we want to handle errors and thats impossible with notifications. """ if not (is_strict_int(wheel) and is_strict_int(speed)): raise InvalidParametersException() status_code = 0 return status_code
def setJointSpeed(joint, speed): r"""Sets speed of a specified joint. Parameters ---------- joint : int Joint selector. speed : int Target speed in scale 1-100. Returns ------- status_code : int Returns 0, because we want to handle errors and thats impossible with notifications. """ if not (is_strict_int(joint) and is_strict_int(speed)): raise InvalidParametersException() # Body status_code = 0 return status_code
def USBCamStartStream(camera): r""" Starts camera streaming -> need to know params for vlc from camera.sdp file Parameters ---------- camera : int Number of camera from /dev/video* """ if not is_strict_int(camera): raise InvalidParametersException() USBCam.startStream(camera)
def getJointSpeed(joint): r"""Returns speed of a specified joint. Parameters ---------- joint : int Joint selector. Returns ------- speed: int Speed of a specified joint in scale 1-100. """ if not is_strict_int(joint): raise InvalidParametersException() speed = 0 return speed
def getJointAngle(joint): r"""Returns angle of a specified joint. Parameters ---------- joint : int Joint selector. Returns ------- angle : float Angle of a specified joint in radians. """ if not is_strict_int(joint): raise InvalidParametersException() angle = 0.0 return angle
def getWheelSpeed(wheel): r"""Returns speed of a specified wheel. Parameters ---------- wheel : int Wheel selector. Returns ------- speed: int Speed of a specified wheel in radians. """ if not is_strict_int(wheel): raise InvalidParametersException() speed = 0 return speed
def setJointAngle(joint, angle): r"""Sets angle of a specified joint. Parameters ---------- joint : int Joint selector. angle : float Target angle in radians. Returns ------- status_code : int Returns 0, because we want to handle errors and thats impossible with notifications. """ if not (is_strict_int(joint) and isinstance(angle, float)): raise InvalidParametersException() # add validation response = manipulator.joints[joint].set_angle(angle) status_code = response.status return status_code