Flying using fixed rotation(Headfree mode)

Firmware/software/electronics/mechanics
otto
Beginner
Posts: 19
Joined: Sat Dec 28, 2013 5:03 pm

Re: Flying using fixed rotation(Headfree mode)

Post by otto »

Hi Alfred,
Cool to see that someone else is doing the same thing! I'd like to see the difference in how you and I implemented the headfree mode or "yaw lock" as you call it.


Additionally,
Alfredvc wrote:Once the button is pressed, the crazyflie will lock its orientation about its vertical axis (fixes the horizontal orientation and yaw commands are ignored)
Does that mean that the Crazyflie will try to counteract any forces that are causing unintentional yaw drifting? For example, if I press your yaw lock button while the flie is facing the same way that I am, and a bit of wind or air circulation spins the flie slightly, the PC client will read the current yaw and adjust for it to make the flie "lock" onto its yaw? Or does your code simply block the yaw commands when the button is pressed?

What I meant by headfree was more like this:
Where the crazyflie gets to rotate, and the controller still has full control over yaw, it's just that the pitch and roll input are unaffected by the yaw of the flie. So if I started up the Crazyflie facing the same way as me, then no matter what the yaw of the crazyflie is at any time, if I push forward on pitch, the crazyflie will go forward relative to me(assuming I haven't moved since startup).
Alfredvc
Beginner
Posts: 12
Joined: Tue Apr 29, 2014 10:54 pm

Re: Flying using fixed rotation(Headfree mode)

Post by Alfredvc »

Yes when the yaw is locked it counteracts external forces. However I imagine that some error will be introduced after a while, some testing is still to be done :-).

Ah, I understand what you mean by headless mode now. It sounds like an interesting idea! Is yours functional?
otto
Beginner
Posts: 19
Joined: Sat Dec 28, 2013 5:03 pm

Re: Flying using fixed rotation(Headfree mode)

Post by otto »

Alfred,
Counteracting external forces sounds really cool, maybe you could even implement that, but without the yaw lock. The user would still have control over yaw, but the yaw that your program locks to is constantly set to the target yaw of the user(or should it be the current yaw?) Basically as a yaw stabilizer. You'd have to do a little work converting the controller's target yaw to a yaw relative to the crazyflie in degrees.

And yes, mine is functional(this makes learning trig so worth it):
otto wrote: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.
Rename bin/cfclient to cfclient.py and run that.

-Otto
mindthomas
Beginner
Posts: 3
Joined: Mon Feb 24, 2014 8:57 pm

Re: Flying using fixed rotation(Headfree mode)

Post by mindthomas »

Alfredvc wrote: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!
I don't think the yaw-locking is the same mode as otto implemented.
In terms of the headfree mode it doesn't lock the yaw, but simply locks the horizontal movement (tilting). So no matter on how to turn the quadcopter (yaw), tilting forward will always tilt the quadcopter forward compared to the original start orientation.

Regards Thomas
Post Reply