amymcgovern / pyparrot

Python interface for Parrot Drones
MIT License
275 stars 129 forks source link

Input Format #127

Closed marcusabate closed 5 years ago

marcusabate commented 5 years ago

Hello,

Again, congrats on the excellent work done here. I have a question about how fly_direct() works. Per the docs it looks like it sends a roll, pitch, yaw and/or "vertical movement" command for an (un)specified duration. These commands are normalized to +-100.

The issue I'm having is that these commands are labeled rpy, but don't correlate directly with actual rpy angles that the aircraft can be set to. I see Minidrone.set_max_tilt(self, value) which implies we cannot give an angle command past the max. Some light testing shows that default max is ~4.5 degrees. Does this mean the rpy "commands" are actually velocity commands in each of the three coordinate axes?

For context, I'm developing a position controller and one of the considerations is how I represent the input to the drone. It could be Euler angles or it could be xyz velocity command inputs. I'm thinking if I'm right about the velocity thing then I can just go at low velocities, say the drone is roughly flat, and call my command input to fly_direct() a velocity input in the xyz directions.

amymcgovern commented 5 years ago

Based on empirical testing with this command (it isn't documented well inside parrot's part of the SDK so I implemented it and use it a lot), it is percent power up to the max tilt and then the sign just tells you which direction it is. The max tilt is far beyond 4.5 though. It is around 25 if I recall correctly? That mambo can go quite fast!

marcusabate commented 5 years ago

Ah yes I've just seen it go more than 4.5, thank you. I plan on using