Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added absolute movement [up, down, right left, rotate (counter)clock… #98

Open
wants to merge 1 commit into
base: develop-0.7.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions tellopy/_internal/tello.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down