Page 1 of 2

Flying using fixed rotation(Headfree mode)

Posted: Sun Apr 27, 2014 12:12 am
by otto
Hi everyone,
I made my crazyfile easier to fly. As a novice flier, I found it difficult to be constantly worrying about the yaw of the crazyflie; it was just one too many things to look at, and trying to figure where the red and green lights were facing all the time made me think. If the Crazyflie is a quadcoptor, why do I always go forward when flying accross the room or trying to move quickly? In other words, isn't each motor equally powerful? So there really isn't any advantage to stopping, rotating, and then going forward, rather, it would be more efficient to be using solely pitch and yaw, and only fiddling with the yaw axis if the flie is stuck in a special corner. And while it is currently possible to use just pitch and yaw, it's very difficult when it's based off the rotation of the file and not the fly-er.

With my changes, it now "ignores" it's yaw and moves in the direction of the user's input relative to the yaw of the flie when it turned on. It is ridiculously easy to fly now; if you are capable of walking around in a PS3 game, this is not much harder.

I would like very much to provide a video, but as of now, I am flying in my tiny bedroom. I would like to move an executable of my modified version of the PC client to a different computer, but when using py2exe, I get the

Code: Select all

LoadLibrary(pythondll) failed
error when I open the cfclient.exe

I downloaded Microsoft Visual C++ 2008 Redistributable Package as suggested here: http://forum.bitcraze.se/viewtopic.php? ... y2exe#p345, but to no avail.


Does anyone have any idea what might be the problem? Or alternatives for compiling?

Re: Flying using fixed rotation

Posted: Sun Apr 27, 2014 9:29 pm
by mindthomas
The proper term of what I think you have just implemented is the so called "Headfree mode".
A quick glance on Youtube and I found this video which displays it the best: https://www.youtube.com/watch?v=4ZPcuYWCVd0

Is this what you have implemented?

Re: Flying using fixed rotation

Posted: Sun Apr 27, 2014 9:52 pm
by otto
Hi mindthomas,
Yes. I'm pretty sure that what is displayed in that video is what I have done. Thanks for finding the name.

I looked it up, and it appears it is generally regarded as a beginner's training mode for people who have difficulty pretending they are facing the same direction as the multicopter. But are there any disadvantages to this? I see no reason to switch back.

Thanks,
Otto

Re: Flying using fixed rotation

Posted: Sun Apr 27, 2014 10:18 pm
by mindthomas
otto wrote:But are there any disadvantages to this? I see no reason to switch back.
With the Headfree mode turned on, you give up even more control to the quadcopter itself.
So for beginners it's a great mode because, just as you mention, a lot of people is struggling with getting the orientation right and figuring out (+remembering) that if your quadcopter front is turned to the right and you start to fly into something on the right, you should not move your roll-switch to the left but move your pitch back ;)

But when you get more used to the controls you wan't to make sure that all the control is in your hands. That is also why a lot of profesionnals, when not doing video recording but flying for fun, is flying in the so called Acrobatic mode where the level sensors (accelerometer) is not being used.
This makes it much more difficult to fly but makes it possible to do faster and more acrobatic maneuvers, such as flips and loops.

Hopefully this explained it a bit.

Re: Flying using fixed rotation

Posted: Mon Apr 28, 2014 11:43 am
by arnaud
Hi otto,
LoadLibrary(pythondll) failed
error when I open the cfclient.exe

Does anyone have any idea what might be the problem? Or alternatives for compiling?
I have never seen this error, what environment are you using (windows, python version?).

The client is in Python and so it does not need to be compiled. When installing py2exe and all libs required for compilation you actually install everything required to run the client directly from source (python-2.7, pyqt4, pygame, pyusb). Just rename bin/cfclient into bin/cfclient.py and double click on it to launch the client from source.

Another solution is to run from within the virtual machine, this should work everywhere but is a bit heavier.

Did you push this code anywhere? I would be curious to try out :).

Re: Flying using fixed rotation

Posted: Mon Apr 28, 2014 2:55 pm
by otto
Arnaud,
Just rename bin/cfclient into bin/cfclient.py and double click on it to launch the client from source.
Thanks for the advice, I will try it as soon as I get a chance.
Did you push this code anywhere? I would be curious to try out .
Not yet. I'll do some polishing up, and then I would be more than happy to push the code.


Thanks,
Otto

Re: Flying using fixed rotation(Headfree mode)

Posted: Mon Apr 28, 2014 10:31 pm
by otto
https://github.com/ottodog/crazyflie-clients-python
That should work. I'll make headfree mode an option with a toggle button as soon as I can.

Re: Flying using fixed rotation(Headfree mode)

Posted: Tue Apr 29, 2014 3:00 pm
by arnaud
This is great fun! really strange to fly without yaw control. I got a bit greedy and almost crashed into Marcus while trying to turn as fast as possible (it gets a bit instable if the yaw rate is too high, I guess it is because the accelerometer is not in the center and catch the centrifugal force).

I is a great beginner mode. I just wonder if we need a button or something to reset the 'front' orientation. Apparently it takes the yaw as front so one has to be careful when starting the copter.

Re: Flying using fixed rotation(Headfree mode)

Posted: Tue Apr 29, 2014 3:33 pm
by otto
This is great fun!
Cool! Glad you enjoyed it!
I just wonder if we need a button or something to reset the 'front' orientation.
Yeah I think it probably needs a toggle button for the mode, as well as a front reset button, maybe added to the controller config. I was also thinking it could constantly set the forward yaw of the crazyflie to the yaw of the controller, but I'm not sure how accurate accelerometer readings from PS3/xbox controllers are. This is why I wanted to make this on android, and use the tablet/smartphones yaw as forward, and additionally change the control system of android from on-screen to completely based off the androids rotation.

Changing yaw of android would not rotate the crazyflie however, it would just change the "forward" of the crazyflie, and the pitch/roll would be the input into the Headfree as normal.

Re: Flying using fixed rotation(Headfree mode)

Posted: Tue Apr 29, 2014 11:03 pm
by Alfredvc
Hei guys, I just recently received my crazyflie so I'm fairly new to the community. I plan to start developing for the crazyflie for fun during the summer but I've decided to get my feet wet.

I really liked the idea of headless mode, so I implemented it similarly to how x-mode is implemented. I also added another controller bind in the controller configuration in order to have a button trigger the headless mode, or yaw lock as I've called it.
Once the button is pressed, the crazyflie will lock its orientation about its vertical axis (fixes the horizontal orientation and yaw commands are ignored) once the assigned button is pressed again it will be unlocked and the pilot is free to yaw the quad as desired.
This has the benefit that you don't have to lock to the startup yaw, but to whichever position you want!
I can post the code tomorrow after I've tested it a little more!