Raspberry Pi Troubles
Raspberry Pi Troubles
I have spent the last couple of days trying to get the crazyflie to work with the Raspberry Pi and I now have it working... sort of. I have the crazyflie and original xbox controller connected and working with the pc client, but once connected the Pi struggles to keep up. I hit thrust on the controller and there is a good couple seconds of lag before the crazyflie responds. This gets worse as time goes by.
Per this post on your blog http://www.bitcraze.se/2012/11/crazyfli ... pberry-pi/, it looks like you guys have had the crazyflie working successfully with the Pi?
I am running the latest version of Raspbian, and have overclocked the Pi to 1GHz using the raspi-config. Pi is powered by a 1A iphone charger and a Belkin 4 port USB hub connects the crazy radio and keyboard. The crazy radio only works correctly when the USB Hub is not powered (usb hub has its own 1A power supply).
The xbox controller is connected directly to the pi (I had issues connecting it through the usb hub) and I used xboxdrv to use connect it to the pi (https://github.com/petrockblog/RetroPie ... controller)
There was a warning that i noticed in the console "WARNING cflib.crazyflie:ExpectAnswer: ERROR! Old timer whas running while scheduling new one on [2]" Not sure if this is an issue?
I am thinking that I might have better luck if i try a different usb hub, since the belkin seems a bit problematic. But the main issue seems to be that my Pi just isn't powerful enough. The activity monitor is completely maxed out when the crazyflie is connected. Anybody have any ideas?
On a happier note, I got the crazyflie working with my windows pc in no time and have been flying around without issues. Its very nimble and robust; a fine piece of work!
Per this post on your blog http://www.bitcraze.se/2012/11/crazyfli ... pberry-pi/, it looks like you guys have had the crazyflie working successfully with the Pi?
I am running the latest version of Raspbian, and have overclocked the Pi to 1GHz using the raspi-config. Pi is powered by a 1A iphone charger and a Belkin 4 port USB hub connects the crazy radio and keyboard. The crazy radio only works correctly when the USB Hub is not powered (usb hub has its own 1A power supply).
The xbox controller is connected directly to the pi (I had issues connecting it through the usb hub) and I used xboxdrv to use connect it to the pi (https://github.com/petrockblog/RetroPie ... controller)
There was a warning that i noticed in the console "WARNING cflib.crazyflie:ExpectAnswer: ERROR! Old timer whas running while scheduling new one on [2]" Not sure if this is an issue?
I am thinking that I might have better luck if i try a different usb hub, since the belkin seems a bit problematic. But the main issue seems to be that my Pi just isn't powerful enough. The activity monitor is completely maxed out when the crazyflie is connected. Anybody have any ideas?
On a happier note, I got the crazyflie working with my windows pc in no time and have been flying around without issues. Its very nimble and robust; a fine piece of work!
Re: Raspberry Pi Troubles
Hi greggius,
For this we used a "headless" version of the client without any UI. Updating the UI with the latest values for logging/joystick is a bit heavy and this is probably where the lag is coming from. I'm not sure of the state for the "headless" client (if it uses the input mappings etc.) but we will check and push what we have into the Bitbucket repository.greggius wrote:I have spent the last couple of days trying to get the crazyflie to work with the Raspberry Pi and I now have it working... sort of. I have the crazyflie and original xbox controller connected and working with the pc client, but once connected the Pi struggles to keep up. I hit thrust on the controller and there is a good couple seconds of lag before the crazyflie responds. This gets worse as time goes by.
Per this post on your blog http://www.bitcraze.se/2012/11/crazyfli ... pberry-pi/, it looks like you guys have had the crazyflie working successfully with the Pi?
Glad to hear that you like itgreggius wrote: On a happier note, I got the crazyflie working with my windows pc in no time and have been flying around without issues. Its very nimble and robust; a fine piece of work!
Re: Raspberry Pi Troubles
As I was just wondering yesterday if you'd make this available somewhere: Way to go!marcus wrote:For this we used a "headless" version of the client without any UI. Updating the UI with the latest values for logging/joystick is a bit heavy and this is probably where the lag is coming from. I'm not sure of the state for the "headless" client (if it uses the input mappings etc.) but we will check and push what we have into the Bitbucket repository.
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
Re: Raspberry Pi Troubles
Ah, I missed that one. I've answered in that thread.
Re: Raspberry Pi Troubles
I downloaded the dev-headless branch, and I now have everything working!
I just needed to modify a couple of lines in lib/cfheadless.py with my values:
and copy in my mapping file : lib/cfclient/configs/input/Xbox1.json
Thanks for all your help marcus!
I just needed to modify a couple of lines in lib/cfheadless.py with my values:
Code: Select all
app = HeadlessClient(sys.argv,link_uri="radio://0/10/250K",
input_config="Xbox1")
Thanks for all your help marcus!
Re: Raspberry Pi Troubles
Got it working as well, my mobile basestation is a go now
FYI, I created a couple of additional udev rules for automatically starting and killing the client upon insertion of the crazyradio:
/etc/udev/rules.d/99-crazyradio.rules
/root/bin/cfheadless
And for the XBox360 Controller (after an "apt-get install xboxdrv"):
/etc/udev/rules.d/99-xbox360.rules
/root/bin/xbox360
This way I can just bootup the Pi completely headless (the two USB ports are just enough for Crazyradio and controller). The only caveat is that I have to replug the Crazyradio dongle if the Crazyflie isn't powered up during start of the headless client, otherwise a connection won't be made.
Hope this helps anyone!
FYI, I created a couple of additional udev rules for automatically starting and killing the client upon insertion of the crazyradio:
/etc/udev/rules.d/99-crazyradio.rules
Code: Select all
SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE=="0664", GROUP="plugdev", RUN+="/root/bin/cfheadless"
Code: Select all
#!/bin/sh
if test "$ACTION" = "add"
then
/usr/bin/sudo -u pi /home/pi/crazyflie-pc-client/bin/cfheadless > /tmp/cfheadless.log 2>&1 &
echo $! > /tmp/cfheadless.pid
else
killall -9 cfheadless
if test -f /tmp/cfheadless.pid
then
PID=`cat /tmp/cfheadless.pid`
kill -9 $PID
fi
fi
/etc/udev/rules.d/99-xbox360.rules
Code: Select all
SUBSYSTEM=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="0719", RUN+="/root/bin/xbox360"
Code: Select all
#!/bin/sh
if test "$ACTION" = "add"
then
/usr/bin/xboxdrv &
else
killall -9 xboxdrv
fi
Hope this helps anyone!
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
Re: Raspberry Pi Troubles
Very nice set-up and thanks for detailing the udev rules. We will make sure to add the instructions to the wiki
Re: Raspberry Pi Troubles
Great! Btw, if you want to I'd also be happy to contribute stuff like this directly to the wiki myself (especially since you chose Dokuwiki -- I used to be take part in its development and simply love it ), if you'd tell me what I need to do to get an account on there (you seem to have disabled registration).
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
Re: Raspberry Pi Troubles
Just send them an email asking to register on the wiki. Given them a username too: http://www.bitcraze.se/about-bitcraze/
Crazyflie Nano 10-DOF | AR Drone v1 | MikroKopter Okto
Re: Raspberry Pi Troubles
Went all-in and bought a small organizer bag yesterday to fit all of the stuff in the picture above when cabled together and running:
Some more infos and pictures here
- Raspberry Pi
- Portable USB power supply (Anker3 10000mAh)
- Crazyradio
- XBox360 controller dongle
Some more infos and pictures here
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107