From 7f923d70f8c22ccbc5990cad1dc41a77652b674d Mon Sep 17 00:00:00 2001 From: Adam D Date: Tue, 25 Apr 2017 00:28:07 -0400 Subject: [PATCH] added return home and roll commands added both return hoem and roll command methods to the drone. roll command has basic error checking but due to the commands being non-ack make it hard to confirm if it happens. --- src/Bybop_Device.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Bybop_Device.py b/src/Bybop_Device.py index 97ff15a..cd9ad60 100644 --- a/src/Bybop_Device.py +++ b/src/Bybop_Device.py @@ -430,6 +430,23 @@ def emergency(self): An emergency request shuts down the motors. """ self.send_data('ardrone3.Piloting.Emergency') + def roll(self,roll_value): + """ + Have the drone move left or right depending on the roll_value. + Refer to here for more information: https://github.com/Parrot-Developers/arsdk-xml/blob/e73425074471c58561d04c85da4a6400b638779d/xml/ardrone3.xml#L66 + NOTE: No acknowledgement is returned. + """ + if((roll_value >100) or (roll_value < -100)): + print("Drone Roll value must be between -100 and 100") + return + self.send_data('ardrone3.Piloting.PCMD',(0,roll_value,0,0,0,0)) + def retHome(self): + """ + Send a return hoome command to the drone + https://github.com/Parrot-Developers/arsdk-xml/blob/e73425074471c58561d04c85da4a6400b638779d/xml/ardrone3.xml#L143 + Sending 1 will send it home + """ + self.send_data('ardrone3.Piloting.NavigateHome',1) class JumpingSumo(Device): def __init__(self, ip, c2d_port, d2c_port):