@@ -124,7 +124,7 @@ def __init__(self):
124124 color_sensors = rospy .get_param ("/mirte/color" )
125125 self .color_services = {}
126126 for sensor in color_sensors :
127- self .color_services [sensor ] = rospy .ServiceProxy ('/mirte/get_color_' + color_sensors [sensor ]["name" ], GetColor , persistent = True )
127+ self .color_services [sensor ] = rospy .ServiceProxy ('/mirte/get_color_' + color_sensors [sensor ]["name" ], GetColorHSL , persistent = True )
128128
129129 self .get_pin_value_service = rospy .ServiceProxy ('/mirte/get_pin_value' , GetPinValue , persistent = True )
130130 self .set_pin_value_service = rospy .ServiceProxy ('/mirte/set_pin_value' , SetPinValue , persistent = True )
@@ -223,11 +223,11 @@ def getColor(self, sensor):
223223 sensor (str): The name of the sensor as defined in the configuration.
224224
225225 Returns:
226- {r, g, b, w }: Raw (0-65536) values per R(ed), G(reen), B(lue ), and W(hite) .
226+ {h, s, l }: Hue (0-360), Saturation (0-1 ), Lightness .
227227 """
228228
229229 value = self .color_services [sensor ]()
230- return {'r ' : value .color .color . r , 'g ' : value .color .color . g , 'b ' : value .color .color . b , 'w' : value . color . color . w }
230+ return {'h ' : value .color .h , 's ' : value .color .s , 'l ' : value .color .l }
231231
232232 def getAnalogPinValue (self , pin ):
233233 """Gets the input value of an analog pin.
0 commit comments