Xbox Controller + Wireless Gaming Receiever + Raspberry Pi

Post here to get support
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Xbox Controller + Wireless Gaming Receiever + Raspberry

Post by foosel »

skube wrote:I corrected the spelling of the mapping file (xbox360_model -> xbox360_mode1) and that worked! Well, I was able to affect Crazyflie with the XBox controller, however the mappings are all messed up for some reason. (Thrust is on the right joystick and diagonal!). Though the output on the xboxdrv tab appears correct, so I'm assuming it must be something with the cfheadless client.
Hm... I just created a new mapping file by running the regular cf client once on the Pi. I copied mine here for you to try, mapping is as follows:
  • Left analog stick: pitch, roll
  • Right analog stick: yaw
  • Right analog trigger (shoulder button): thrust
  • Button pad: trimming for pitch and roll
  • Start: kill switch (not tested yet)
  • Back: exit app (not tested yet)
For the record, I found manipulating thrust via the shoulder button to be way more easier for me than via the analog stick but your mileage may vary.
foosel wrote: As you are running cfheadless as root (why?)
Probably cause I don't know what I'm doing :D Does it matter though? Can I just leave running as root as is?
Of course you can. It's just not something that's usually done or recommended, since you should never trust any application to have access to the whole system. First job after uni was as a sys admin, never got the "eeek, it's running as root" out of my system, sorry ;)
Also, when trying to start the xboxdrv, it seems to only work when I switch to root (su -)
That's at least what I remembered too, hence the sudo I mentioned above... If your crazyflie happens to work with the mapping above, next step would be to figure out what's wrong with your udev stuff... do you get any hints in the syslog? What happens if you execute the two scripts under /root/bin manually (you'll have to give start as a parameter, e.g. /root/bin/cfheadless start), does it start up xboxdrv respectively the client then?
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
skube
Member
Posts: 55
Joined: Fri May 03, 2013 2:41 pm
Location: Toronto, Canada

Re: Xbox Controller + Wireless Gaming Receiever + Raspberry

Post by skube »

OMG. Thanks so much for this foosel! I'm in the process of trying this out but I need to recharge my CF. Also, I've re-cloned the repo as my default user - instead of being in root - so all is safe and proper. ;)

As for the mappings and using the shoulder/trigger buttons instead, I never even thought you could do that! Actually, I thought the digital button pad didn't work (or there was some issue with it) with Crazyflie client.

I'll let you know if it works for me. Thanks again!

edit: YES! It's alive! Thrust is a little touchy still and not very consistent, but I'll take it for now. Thanks so much. Now, if I could get the udev stuff working - but maybe we'll leave it to another day. :)
Crazyflie Nano 10-DOF | AR Drone v1 | MikroKopter Okto
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Xbox Controller + Wireless Gaming Receiever + Raspberry

Post by foosel »

Heh, you are welcome :)
skube wrote:As for the mappings and using the shoulder/trigger buttons instead, I never even thought you could do that! Actually, I thought the digital button pad didn't work (or there was some issue with it) with Crazyflie client.
Careful there, the sticks and the shoulder triggers (the "button" above might have been misleading, sorry for that) are analog and hence work (the controller actually has 6 axis, two on the left stick, two on the right and the two shoulder triggers), the buttons above the triggers, the digipad and the digital buttons on the right won't work for steering (if they would, it would get pretty stressy I think :D). The digipad won't work for trimming either (which is why I used the button pad). So we have two working buttons and an analog trigger left for future Crazyflie functionality, four more buttons if the digipad starts working.
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
timsson
Beginner
Posts: 8
Joined: Wed May 15, 2013 8:09 am

Xbox Controller + Wireless Gaming Receiever + Raspberry Pi

Post by timsson »

Hi,
I use also the Pi to fly the CF.
How can I activate the hover mode with a xbox-controller???

https://bitbucket.org/phiamo/crazyflie- ... t/overview
I change the xbox.json with hover buttons
With python cfclient the GUI is busy/lazy
If I use phiamo source I can't start cfheadless
-> hg up dev-headless
no hover_mode ???
Thanks
Post Reply