update documentation

This commit is contained in:
Konstantin Lampalzer 2022-10-13 00:31:43 +02:00
parent e1a17808f7
commit af3aaf7998
7 changed files with 88 additions and 16 deletions

View file

@ -3,33 +3,35 @@ from compLib.CompLibClient import CompLibClient
class Encoder(object):
"""Class used to read the encoders
"""Klasse zum Zugriff auf die Encoder der einzelnen Motoren
"""
@staticmethod
def read_all_positions():
"""Read all encoder positions.
"""Lesen aller absoluten Positionen der einzelnen Encoder
:return: Tuple of all current encoder positions
:return: Tupel mit allen aktuellen Encoderpositionen
"""
request = CompLib_pb2.EncoderReadPositionsRequest()
request.header.message_type = request.DESCRIPTOR.full_name
response = CompLib_pb2.EncoderReadPositionsResponse()
response.ParseFromString(CompLibClient.send(request.SerializeToString(), request.ByteSize()))
response.ParseFromString(CompLibClient.send(
request.SerializeToString(), request.ByteSize()))
return tuple(i for i in response.positions)
@staticmethod
def read_all_velocities():
"""Read the velocity of all motors connected.
"""Lesen der Geschwindigkeit aller angeschlossenen Motoren.
:return: Tuple of all current motor velocities
:return: Tupel aller aktuellen Motorgeschwindigkeiten in Radianten pro Sekunde
"""
request = CompLib_pb2.EncoderReadVelocitiesRequest()
request.header.message_type = request.DESCRIPTOR.full_name
response = CompLib_pb2.EncoderReadVelocitiesResponse()
response.ParseFromString(CompLibClient.send(request.SerializeToString(), request.ByteSize()))
response.ParseFromString(CompLibClient.send(
request.SerializeToString(), request.ByteSize()))
return tuple(i for i in response.velocities)

View file

@ -6,14 +6,14 @@ from compLib.CompLibClient import CompLibClient
class IRSensor(object):
"""Access the different IR Sensors of the robot
"""Ermöglicht den Zugriff auf die einzelnen IRSensoren des Roboters
"""
@staticmethod
def read_all():
"""Read all IR sensors at once.
"""Auslesen aller Sensoren gleichzeitig
:return: Array of all current ir sensors
:return: Array aller Sensorwerte
"""
request = CompLib_pb2.IRSensorsReadAllRequest()
request.header.message_type = request.DESCRIPTOR.full_name
@ -26,7 +26,7 @@ class IRSensor(object):
@staticmethod
def enable():
"""Turn on all IR emitters
"""Aktivieren Infrarot-Sender. Muss bei jedem Programmstart ausgeführt werden.
"""
request = CompLib_pb2.IRSensorsEnableRequest()
request.header.message_type = request.DESCRIPTOR.full_name
@ -36,7 +36,7 @@ class IRSensor(object):
@staticmethod
def disable():
"""Turn off all IR emitters
"""Deaktivieren der Infrarot-Sender
"""
request = CompLib_pb2.IRSensorsDisableRequest()
request.header.message_type = request.DESCRIPTOR.full_name