@@ -541,7 +541,7 @@ def get_color_raw(self) -> (int, int, int):
541
541
# int((self.green/COLOR_FULL_SCALE)*255),
542
542
# int((self.blue/COLOR_FULL_SCALE)*255))
543
543
544
- def get_distance (self , unit : str = 'cm' ) -> (int , int , int , int , int ):
544
+ def get_distance (self , unit : str = 'cm' ) -> (float , float , float , float , float ):
545
545
"""
546
546
Returns the distance readout of the TOF sensor
547
547
:param unit: distance output unit
@@ -553,6 +553,22 @@ def get_distance(self, unit: str = 'cm') -> (int, int, int, int, int):
553
553
convert_distance (self .center_right_tof , 'mm' , unit ),
554
554
convert_distance (self .right_tof , 'mm' , unit ))
555
555
556
+ def get_distance_top (self , unit : str = 'cm' ) -> float :
557
+ """
558
+ Returns the obstacle top distance readout
559
+ :param unit:
560
+ :return:
561
+ """
562
+ return convert_distance (self .top_tof , 'mm' , unit )
563
+
564
+ def get_distance_bottom (self , unit : str = 'cm' ) -> float :
565
+ """
566
+ Returns the obstacle bottom distance readout
567
+ :param unit:
568
+ :return:
569
+ """
570
+ return convert_distance (self .bottom_tof , 'mm' , unit )
571
+
556
572
def get_version (self ) -> str :
557
573
"""
558
574
Returns the firmware version of the Alvik
0 commit comments