This commit is contained in:
Konstantin Lampalzer 2022-10-07 16:35:37 +02:00
parent c16a7172e7
commit d4a7d8c0c0
186 changed files with 1 additions and 7056 deletions

View file

@ -1,40 +0,0 @@
import compLib.CompLib_pb2 as CompLib_pb2
from compLib.CompLibClient import CompLibClient
class IRSensor(object):
"""Access the different IR Sensors of the robot
"""
@staticmethod
def read_all():
"""Read all IR sensors at once.
:return: Array of all current ir sensors
"""
request = CompLib_pb2.IRSensorsReadAllRequest()
request.header.message_type = request.DESCRIPTOR.full_name
response = CompLib_pb2.IRSensorsReadAllResponse()
response.ParseFromString(CompLibClient.send(request.SerializeToString(), request.ByteSize()))
return [i for i in response.data]
@staticmethod
def enable():
"""Turn on all IR emitters
"""
request = CompLib_pb2.IRSensorsEnableRequest()
request.header.message_type = request.DESCRIPTOR.full_name
CompLibClient.send(request.SerializeToString(), request.ByteSize())
@staticmethod
def disable():
"""Turn off all IR emitters
"""
request = CompLib_pb2.IRSensorsDisableRequest()
request.header.message_type = request.DESCRIPTOR.full_name
CompLibClient.send(request.SerializeToString(), request.ByteSize())