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

Flight time increases when using multiple move()-commands #20

Open
andixd opened this issue Jun 23, 2014 · 1 comment
Open

Flight time increases when using multiple move()-commands #20

andixd opened this issue Jun 23, 2014 · 1 comment

Comments

@andixd
Copy link

andixd commented Jun 23, 2014

I'm using the YADrone-Lib with Processing 2.2.1 to control my AR Drone 2.0.

When using multiple move()-commands it seems to add the past time to the time of the current command.

Example:
cmd.move(10, 0, 0, 0).doFor(1000);
cmd.move(0, 10, 0, 0).doFor(1000);
cmd.move(-10, 0, 0, 0).doFor(1000);
cmd.move(0, -10, 0, 0).doFor(1000);

This should move the drone forward, left, back and right (each for 1 second).
The script executes each command at the right time (each after 1000 millis), but the drone doesn't react properly.
In my case its more like 1 second forward, 2 seconds left, 3 seconds back, ... or sometimes even more confusing.

Most of the times it seems to work properly only once after first connecting with the drone. The following runs show that weird behavior.

@MahatmaX
Copy link
Owner

Hi,
the move-function has been adopted from the ARDroneForP5-project, I
personally have not yet tested it - and due to a lack of time I am
currently not able to :-( - but there are some things you might want to try:

  1. There are 2 move-functions (with 4 parameters):
  • move(float lrtilt, float fbtilt, float vspeed, float aspeed)
  • move(int speedX, int speedY, int speedZ, int speedSpin)

You are using the latter. Actually, that one calls the first one, but
transforms parameter. I would suggest to test the first one instead.
Instead of e.g. cmd.move(10, 0, 0, 0) use absolute float values like
e.g. cmd.move(0.5, 0.0, 0.5, 0.5) (all parameters must be in range
[-1,+1]) and see what happens. The commands are scheduled like any other
command, therefore I think the scheduling should be fine.

  1. I mostly use forward(), backward(), goLeft(), goRight() instead.
    These should work fine for your case.

If you tested it, I would be glad if you get back to me and report your
findings. If there is a problem with the move function, I would open an
Issue on Github and try to solve that as soon as I have more time (in
August).

Thanks for your report so far,
Cheers Dirk

Am 23.06.2014 10:10, schrieb andiced:

I'm using the YADrone-Lib with Processing 2.2.1 to control my AR Drone 2.0.

When using multiple move()-commands it seems to add the past time to the
time of the current command.

Example:
cmd.move(10, 0, 0, 0).doFor(1000);
cmd.move(0, 10, 0, 0).doFor(1000);
cmd.move(-10, 0, 0, 0).doFor(1000);
cmd.move(0, -10, 0, 0).doFor(1000);

This should move the drone forward, left, back and right (each for 1
second).
The script executes each command at the right time (each after 1000
millis), but the drone doesn't react properly.
In my case its more like 1 second forward, 2 seconds left, 3 seconds
back, ... or sometimes even more confusing.

Most of the times it seems to work properly only once after first
connecting with the drone. The following runs show that weird behavior.


Reply to this email directly or view it on GitHub
#20.

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

No branches or pull requests

2 participants