diff --git a/tellopy/_internal/tello.py b/tellopy/_internal/tello.py index c557d275..e95aa35a 100755 --- a/tellopy/_internal/tello.py +++ b/tellopy/_internal/tello.py @@ -325,6 +325,53 @@ def take_picture(self): log.info('take picture') return self.send_packet_data(TAKE_PICTURE_COMMAND, type=0x68) + def go_up_absolute(self, val): + """go_up_absolute tells the drone to ascend an absolute value. + Pass in an int which represents the height in cm""" + + log.info('go up absolute(val=%d)' % val) + packet = Packet(cmd=f"up {str(val)}") + self.send_packet(packet) + + def go_down_absolute(self, val): + """go_down_absolute tells the drone to descend an absolute value. + Pass in an int which represents the height in cm""" + + log.info('go down absolute(val=%d)' % val) + packet = Packet(cmd=f"down {str(val)}") + self.send_packet(packet) + + def go_right_absolute(self, val): + """go_right_absolute tells the drone to move an absolute right. + Pass in an int which represents the height in cm""" + + log.info("go right(val=%d)" % val) + packet = Packet(cmd=f"right {str(val)}") + self.send_packet(packet) + + def go_left_absolute(self, val): + """go_left_absolute tells the drone to move an absolute distance left. + Pass in an int which represents the height in cm""" + log.info("go left(val=%d)" % val) + packet = Packet(cmd=f"left {str(val)}") + self.send_packet(packet) + + def rotate_cw_absolute(self, val): + """rotate_cw_absolute tells the drone to rotate clockwise. + Pass in an int which represents degrees to rotate """ + + log.info("rotate cw(val=%d)" % val) + packet = Packet(cmd=f"cw {str(val)}") + self.send_packet(packet) + + def rotate_ccw_absolute(self, val): + """rotate_ccw_absolute tells the drone to rotate counter_clockwise. + Pass in an int which represents degrees to rotate """ + log.info("rotate ccw(val=%d)" % val) + packet = Packet(cmd=f"ccw {str(val)}") + + self.send_packet(packet) + def up(self, val): """Up tells the drone to ascend. Pass in an int from 0-100.""" log.info('up(val=%d)' % val)