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 return home and roll commands #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

asoccer
Copy link

@asoccer asoccer commented Apr 25, 2017

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.

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.
Copy link
Owner

@N-Bz N-Bz left a 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))
Copy link
Owner

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
Copy link
Owner

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):
Copy link
Owner

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)
Copy link
Owner

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

@N-Bz N-Bz mentioned this pull request May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants