How To Fly CF with Android & Macbook?

Discussions and questions about the Crazyflie Nano Quadcopter
dwaddsy
Beginner
Posts: 25
Joined: Thu May 09, 2013 5:57 am

How To Fly CF with Android & Macbook?

Post by dwaddsy »

Hello,

I have an android cell and a macbook pro. Can anyone please help me as I have my CF ready to fly but no controller to do so. Just my android and macbook pro. Any link to a walk through on how to do so or advice? I am not a programmer just a guy with common sense, general hobby skills and good instruction following capabilities!
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: How To Fly CF with Android & Macbook?

Post by foosel »

Given that droidmote doesn't seem to be available for Macs, you basically have threeoptions: Use the Bitcraze VM (in VirtualBox for OS X hosts) plus the Droidmote Server (for Linux) and try to get it to work this way, or (probably the faster way) get yourself a (cheap) Mac-compatible gamepad with dual analog sticks, or use the Android client plus an USB OTG cable to fly your CF from your Android device (which I already described here).
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
dwaddsy
Beginner
Posts: 25
Joined: Thu May 09, 2013 5:57 am

Re: How To Fly CF with Android & Macbook?

Post by dwaddsy »

foosel wrote:Given that droidmote doesn't seem to be available for Macs, you basically have threeoptions: Use the Bitcraze VM (in VirtualBox for OS X hosts) plus the Droidmote Server (for Linux) and try to get it to work this way, or (probably the faster way) get yourself a (cheap) Mac-compatible gamepad with dual analog sticks, or use the Android client plus an USB OTG cable to fly your CF from your Android device (which I already described here).
Hi Foosel,

Thank you for your response. I feel as though I am in over my head with the programs and coding. Is there anyway you would be able to direct me to somewhere or someway so a laymen such as myself would be able to successfully set up the system with my macbook and android to fly my CF. Poor little thing is just sitting on my desk begging to be flown =(.

Thank you for your patience!
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: How To Fly CF with Android & Macbook?

Post by foosel »

Since I do not own a Mac (and never will ;)) I can't really help you with much more details than the above, however maybe someone else will chime in who has.

In all honesty though, if I were you I'd just spend the 20 or so bucks for a gamepad.
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
dwaddsy
Beginner
Posts: 25
Joined: Thu May 09, 2013 5:57 am

Re: How To Fly CF with Android & Macbook?

Post by dwaddsy »

foosel wrote:Since I do not own a Mac (and never will ;)) I can't really help you with much more details than the above, however maybe someone else will chime in who has.

In all honesty though, if I were you I'd just spend the 20 or so bucks for a gamepad.
Can you tell me what a gamepad is? like a playstation controller? What do I do with it? I'm sorry I really am not following =(
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: How To Fly CF with Android & Macbook?

Post by foosel »

A gamepad is an input device like the mouse or keyboard, only used with two hands. Or, as Wikipedia puts it
Wikipedia wrote:A gamepad (also called joypad or control pad), is a type of game controller held in two hands, where the fingers (especially thumbs) are used to provide input.
Usually one associates them with game consoles like the Playstation or the XBOX (or -- way back -- something like the SNES), but there also exist variants for use with regular computers, usually connected via USB. One of those is the "Xbox 360 Wireless Controller for Windows" which I use. Looks like this (although the black one is more common these days):
gamepad.png
The two thingies pointed at with the red arrows are analog sticks. Think of them as tiny joysticks. Other than digital inputs (such as the colored buttons you see on that thing, or keyboard keys, or mouse buttons) those do not only support two states (pressed or not pressed), but the amount of "pressed" can also be detected, which makes them suited for flying something like the Crazyflie (you don't want it either flying in one direction with all its power, or not move it all, but you want to have more refined control, therefore -> analog inputs). You need two analog sticks (which equal four analog inputs, as they can both be moved up/down and left/right) to control the CF: With one stick you control in which directions it's moving (movement forward, backward, left, right), with the other you control the thrust of the motors and therefore its height (more/less => up/down) and in which direction it's facing (rotation left/right). For some pictures see this entry in the Wiki.

You can get a gamepad like this at Amazon.com. I personally prefer something wireless such as the above Xbox 360 controller because it allows me to move with the CF, however wireless controllers are more expensive than wired ones (40 vs 20 bucks). You have to make sure to get one that has USB and is supported by your Mac. My understanding would be that any gamepad with a USB connector will be supported, but I might be mistaken. The Xbox360 for PC one seems to be supported via an additional driver, see here. Less expensive options might even work out of the box. Your best option would probably be to go into a store that sells stuff like gaming consoles and computer hardware, they will most probably have gamepads as well, and then just ask the sells rep about Mac compatibility.

If you have one of those, you plug it in, install the drivers (if necessary), install the drivers for the Crazyradio and the Crazyflie PC Client (how is described here), switch on your CF, connect to it and fly (you might want to remap the controls to your liking in the Crazyflie Client, some people prefer having the movement on the left and the height and facing on the right stick, that's called Mode 1, others prefer it just the other way around, that's called Mode 2).
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
dwaddsy
Beginner
Posts: 25
Joined: Thu May 09, 2013 5:57 am

Re: How To Fly CF with Android & Macbook?

Post by dwaddsy »

foosel wrote:A gamepad is an input device like the mouse or keyboard, only used with two hands. Or, as Wikipedia puts it
Wikipedia wrote:A gamepad (also called joypad or control pad), is a type of game controller held in two hands, where the fingers (especially thumbs) are used to provide input.
Usually one associates them with game consoles like the Playstation or the XBOX (or -- way back -- something like the SNES), but there also exist variants for use with regular computers, usually connected via USB. One of those is the "Xbox 360 Wireless Controller for Windows" which I use. Looks like this (although the black one is more common these days):
gamepad.png
The two thingies pointed at with the red arrows are analog sticks. Think of them as tiny joysticks. Other than digital inputs (such as the colored buttons you see on that thing, or keyboard keys, or mouse buttons) those do not only support two states (pressed or not pressed), but the amount of "pressed" can also be detected, which makes them suited for flying something like the Crazyflie (you don't want it either flying in one direction with all its power, or not move it all, but you want to have more refined control, therefore -> analog inputs). You need two analog sticks (which equal four analog inputs, as they can both be moved up/down and left/right) to control the CF: With one stick you control in which directions it's moving (movement forward, backward, left, right), with the other you control the thrust of the motors and therefore its height (more/less => up/down) and in which direction it's facing (rotation left/right). For some pictures see this entry in the Wiki.

You can get a gamepad like this at Amazon.com. I personally prefer something wireless such as the above Xbox 360 controller because it allows me to move with the CF, however wireless controllers are more expensive than wired ones (40 vs 20 bucks). You have to make sure to get one that has USB and is supported by your Mac. My understanding would be that any gamepad with a USB connector will be supported, but I might be mistaken. The Xbox360 for PC one seems to be supported via an additional driver, see here. Less expensive options might even work out of the box. Your best option would probably be to go into a store that sells stuff like gaming consoles and computer hardware, they will most probably have gamepads as well, and then just ask the sells rep about Mac compatibility.

If you have one of those, you plug it in, install the drivers (if necessary), install the drivers for the Crazyradio and the Crazyflie PC Client (how is described here), switch on your CF, connect to it and fly (you might want to remap the controls to your liking in the Crazyflie Client, some people prefer having the movement on the left and the height and facing on the right stick, that's called Mode 1, others prefer it just the other way around, that's called Mode 2).
Thank you for your extremely detailed response! I will go to Bestbuy tomorrow and buy a Mac compatible controller with USB as you have mentioned. I hope all goes well so I can finally get my little CF airborne!
dwaddsy
Beginner
Posts: 25
Joined: Thu May 09, 2013 5:57 am

Re: How To Fly CF with Android & Macbook?

Post by dwaddsy »

This really sucks. I have had my CF for a couple weeks now it seems and I have bought an XBOX 360 wireless controller. I tried for hours to upload the Mac driver from multiple different links and I keep getting the same error (check image attached). I'm about to give up and just sell my CF. I cannot believe that NOBODY has been able to fly a CF on a macbook.....wtf.....
Screen shot 2013-06-08 at 2.26.38 AM.png
zak
Beginner
Posts: 24
Joined: Thu Jun 06, 2013 6:53 am

Re: How To Fly CF with Android & Macbook?

Post by zak »

dwaddsy wrote:I cannot believe that NOBODY has been able to fly a CF on a macbook.....wtf.....
This is a bit sad! I'm using a Macbook to fly right now, but through a virtual machine. Although they sound scary, they're pretty easy to get going (honest!). I'll try to give a quick step-by-step. I'm going to assume you can use Bittorrent to download files - if you can't or are confused by what I mean, just do the first step only and I'll give separate instructions for doing it a different way.
  1. Download and install VirtualBox. You'll need the version for OS X hosts (for you, OS X will be the 'host' operating system while Linux will be the 'guest'). While you're there, get the extension pack too - once you've installed VirtualBox, double-clicking on the extension package and you'll be prompted to install it.
  2. Next, you'll need to get hold of your guest OS. As I mentioned before, we'll use the Bitcraze VM as this has everything installed for you already.
  3. Double click on the downloaded Bitcraze VM file. VirtualBox will unpack the guest OS and it will appear in your list of virtual machines.
  4. Next, we need to give your virtual machine access to the Crazyradio and your controller. Connect them both to your Macbook, highlight Ubuntu Bitcraze in VirtualBox and click the Settings button. Under the Ports tab, select USB and click the green plus. Choose the Crazyradio dongle, then click the button again and choose your Xbox controller (see attached image). Once you've done this, disconnect the controller. This is to get around the host OS (OS X) holding onto the controller and stopping the guest OS from accessing it.
    VBoxUSB.png
  5. Start the virtual machine! It will appear in a window on your Macbook - if you want it to be full-screen, use the shortcut command+F.
  6. The Bitcraze VM is a bit out of date. Open terminal (on the desktop of the virtual machine), and type 'cd projects/crazyflie-pc-client' followed by 'hg pull && hg update'. This will update your client to the latest version.
  7. Plug in your controller, turn on your Crazyflie and start the client with the command 'python bin/cfclient'. Everything should start up and you will see the connect button in the top-left of the client window.
  8. When you click the connect button, you should see an entry that starts with the word 'radio'. Select this one (and click the second connect button), and you should be connected to your flie - check by moving the flie around and seeing if the horizon moves.
  9. Now, unfortunately, is the bit I can't help you with - I fly with a wired PS3 controller rather than a wireless XBox one. Hopefully at the bottom of your client it will be telling you that you're using a controller rather than something like 'VirtualBox USB Tablet'. Hopefully someone using a wireless XBox controller inside a virtual machine can chime in here.
Good luck! I'm sorry if I've left anything out - I've tried my best to lead you through the steps I took to get flying but I may well have left something out. Please feel free to post back here and ask any questions.
Last edited by zak on Mon Jun 10, 2013 11:08 am, edited 1 time in total.
Fucitol
Beginner
Posts: 19
Joined: Wed May 08, 2013 7:49 am

Re: How To Fly CF with Android & Macbook?

Post by Fucitol »

Just FYI, I use a Macbook Pro without the VM and it is working just fine. I installed all Python packages in a Virtual Environment using pip combined with the brew commands as listed on the Wiki. Let me know if you need help with setting up Pythons virtual environment (https://pypi.python.org/pypi/virtualenv, http://docs.python-guide.org/en/latest/ ... lenvs.html)).

Edit: I'm using a PS3 controller which connects wirelessly to my Macbook (Bluetooth), not experience with the Xbox controller
Post Reply