-
Notifications
You must be signed in to change notification settings - Fork 21
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 return home and roll commands #6
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be consistant with the rest of the project, the function should be named |
||
""" | ||
Send a return hoome command to the drone | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo |
||
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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should propagate the return value of |
||
|
||
class JumpingSumo(Device): | ||
def __init__(self, ip, c2d_port, d2c_port): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As stated in the documentation, you'll have to se the flag (1st argument) to 1 when setting a non-zero roll (or pitch) value.
Another problem is that the drone expects the PCMD to be periodic, and will revert to a "zero" (hovering) command if no PCMD is recieved in the last 500ms (in current firmwares). That's why we have an internal send loop in
libARController
for this command (and other periodic commands)All in all, developing a proper
drone.set_pcmd(...)
command would require more work.