-
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?
Conversation
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.
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.
In this current form, the roll function will not work. The function will require an internal periodic loop to ensure that the command is sent as a constant rate.
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)) |
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.
self.send_data('ardrone3.Piloting.PCMD',(0,roll_value,0,0,0,0)) | ||
def retHome(self): | ||
""" | ||
Send a return hoome command to the drone |
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.
Typo
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 comment
The 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 return_home
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 comment
The reason will be displayed to describe this comment to others. Learn more.
You should propagate the return value of send_data
to the caller (as it is done in the JumpingSumo.change_posture()
function. I will add the same returns to other functions in the BebopDrone
class
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.