New program to control the crazyflie with your keyboard

Firmware/software/electronics/mechanics
kikill
Beginner
Posts: 7
Joined: Sat Dec 28, 2013 9:47 am

Re: New program to control the crazyflie with your keyboard

Post by kikill »

sorry i didn't reply sooner : here is the code https://bitbucket.org/kikill/hova
i failed to make it work as i hoped, i guess i miss some flight knowledge, in order to make the CF hovering :oops:
kikill
Beginner
Posts: 7
Joined: Sat Dec 28, 2013 9:47 am

Re: New program to control the crazyflie with your keyboard

Post by kikill »

brownyoda wrote:Hey. I just started working with crazyflie.
I wanted to try your program. I'm using the virtual machine and I'm not sure where to put your file to run it. This might sound really easy and I apologize, but I'm new to this. I don't have a game controller and I want to control my crazyflie with a program like you created. Please help.
maybe you can try this quick tutorial
launch terminal and type those commands :

cd ~/projects
git clone https://bitbucket.org/eldraco2000/crazy ... ograms.git
copy -R crazyflie-pc-client/lib/* crazyflie-programs
cd crazyflie-programs
./keyboard_control.py
brownyoda
Beginner
Posts: 3
Joined: Sun Jan 26, 2014 11:29 am

Re: New program to control the crazyflie with your keyboard

Post by brownyoda »

orcinus wrote:It appears the script tends to crash after you reach a certain throttle level (i'm assuming due to an overflow of some kind).
I believe the overflow is caused by line 237

Code: Select all

elif key == 's' and (thrust - thrust_increment >= min_roll):
instead of min_roll it should be min_thrust

Code: Select all

elif key == 's' and (thrust - thrust_increment >= min_thrust):
c1a1
Beginner
Posts: 2
Joined: Thu May 15, 2014 10:05 am

Re: New program to control the crazyflie with your keyboard

Post by c1a1 »

Here's another linux newbie looking for help!
I tried kikill's tutorial and got this message:

Code: Select all

Initializing drivers
Searching for available devices
Connecting to interface with URI [radio://0/10/250k] and name
Traceback (most recent call last):
  File "./keyboard_control.py", line 288, in <module>
    TestFlight()
  File "./keyboard_control.py", line 93, in __init__
    self.crazyflie.connectSetupFinished.add_callback(self.connectSetupFinished)
AttributeError: Crazyflie instance has no attribute 'connectSetupFinished'
No handlers could be found for logger "cflib.crazyflie.toccache"
What should I do?
ToeBee
Beginner
Posts: 4
Joined: Sun May 11, 2014 7:29 pm

Re: New program to control the crazyflie with your keyboard

Post by ToeBee »

I just tried this and ran into a problem with the current master of cfclient on GitHub. Looks like they changed the name of a callback. It couldn't find connectSetupFinished so I changed this line (93):

Code: Select all

self.crazyflie.connectSetupFinished.add_callback(self.connectSetupFinished)
to this:

Code: Select all

self.crazyflie.connected.add_callback(self.connectSetupFinished)
It works. Not exactly easy to control in a small room but it works :)

Now I need to get hover mode working...
c1a1
Beginner
Posts: 2
Joined: Thu May 15, 2014 10:05 am

Re: New program to control the crazyflie with your keyboard

Post by c1a1 »

ToeBee wrote:I just tried this and ran into a problem with the current master of cfclient on GitHub. Looks like they changed the name of a callback. It couldn't find connectSetupFinished so I changed this line (93):

Code: Select all

self.crazyflie.connectSetupFinished.add_callback(self.connectSetupFinished)
to this:

Code: Select all

self.crazyflie.connected.add_callback(self.connectSetupFinished)
It works. Not exactly easy to control in a small room but it works :)

Now I need to get hover mode working...
It crashes sometimes but anyway it works! Thanks a lot!
klopfie
Beginner
Posts: 2
Joined: Wed Jun 11, 2014 1:51 pm

Re: New program to control the crazyflie with your keyboard

Post by klopfie »

hello

sry for this easy question but where must i put the files when i dont use a VM ?
Post Reply