Page 1 of 1

[SOLVED]CF2 Launched into wall as soon as cfclient connected

Posted: Sat Dec 27, 2014 6:45 am
by lxrocks
I finally got my hands on a PS Dual Shock 3, connected it to my mac, started cfclient and connected to the Radio and CF2 just launched into the wall like a missile - missed my face by inches :)

So what did I do wrong here?

Is it likely the controller is faulty , I don't have PS so how do I test it?

Re: CF2 Launched into wall as soon as cfclient connected.

Posted: Sat Dec 27, 2014 7:38 am
by chad
I've noticed with both the CF1 and CF2 on my Mac that sometimes when I plug in my PS3 controller, the inputs have some insane values (like thrust @ 72%). Once I hit the PS button, they typically reset to default (0) values. Take a look at the "Flight Control" tab in the client, just below the artificial horizon in the "Target" column. If these fields show crazy values when you're not touching the controller, try to hit the PS button prior to connecting to the Crazyflie. If hitting the PS button doesn't correct them, disconnect and reconnect the PS controller either via the USB cable if wired or from the Bluetooth menu if wireless.

It's good to be in the habit of checking the "Target" values (input values) before you hit the Connect button. If pitch, roll, and yaw fluctuate, it's not an issue but make sure thrust is at 0 before connecting. Another thing I sometimes do (especially if I'm running the headless client on my Mac) is turn on the Crazyflie, then after the self-test, flip it upside down just prior to connecting (starting up cfheadless). If it stays still, I flip it back over and commence flying. I only do this if I'm running the headless client on my Mac though. :o

Re: CF2 Launched into wall as soon as cfclient connected.

Posted: Sat Dec 27, 2014 11:20 am
by mlundh
I noticed the same problem, and i actually created an issue about it on the CF firmware github repo. I think that the firmware should do some sanity checks before allowing the motors to start. In the mean time, the check that chad mentioned is the only way to be sure.

Re: CF2 Launched into wall as soon as cfclient connected.

Posted: Sat Dec 27, 2014 11:32 am
by lxrocks
Thanks for the advice Chad.

After replacing a broken motor, I started it up again making sure i had a firm grip on the CF2. Thrust was 0.0% so there were no problems. A lesson learnt for me. I don't have much experience with game equipment so have a bit of learning curve. My goal was to play with the code and see what i can get it to do, however I realise I actually have a lot to learn about flying before I can get into the code

:)