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

Re: How To Fly CF with Android & Macbook?

Post by dwaddsy » Sun Jun 09, 2013 8:12 pm

zak wrote:
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.
    The attachment VBoxUSB.png is no longer available
  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. You should see an entry that starts with the word 'radio'. Connect to this one, 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.
thank you for your help.

I got stuck on 6. I typed that into the terminal and it from what it looked like it didn't give me errors. I moved onto 7 but I got stuck so I closed everything down and when I opened everything back up again the program shows that it has a lot of updates. What does this mean? does this mean that the terminal command did not work?

I tried to move onto 7. and typed in the command and I was able to see horizon etc but it was non responsive to my crazyflie. I then shut everything down to take a break and when I came back to everything I was unable to find a way to open this window with the horizon again. I even tried typing in python bin/cfclient into the terminal but this time it just gave me an error message.

Wow I had no idea what I was getting into. This CF seems to be best left for the professional programmers =( Can anyone help a laymen here?
Attachments
Screen shot 2013-06-09 at 1.07.21 PM.png



dwaddsy
Beginner
Posts: 25
Joined: Thu May 09, 2013 5:57 am

Re: How To Fly CF with Android & Macbook?

Post by dwaddsy » Sun Jun 09, 2013 10:45 pm

Fucitol wrote: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
Hello thank you for your response. I even tried to go your way and I went to the link and downloaded something but then when I opened the folder I just see a bunch of files that are completely foreign to me. I am lost please help!

dwaddsy
Beginner
Posts: 25
Joined: Thu May 09, 2013 5:57 am

Re: How To Fly CF with Android & Macbook?

Post by dwaddsy » Sun Jun 09, 2013 11:21 pm

can't get the terminal to work either. I followed the instructions and typed in terminal exactly what was told in the readme.text and this is what it keeps doing.
Attachments
Screen shot 2013-06-09 at 4.20.05 PM.png

smiler
Member
Posts: 30
Joined: Wed May 08, 2013 2:51 pm
Location: Uppsala, Sweden

Re: How To Fly CF with Android & Macbook?

Post by smiler » Mon Jun 10, 2013 7:09 am

dwaddsy wrote:I cannot believe that NOBODY has been able to fly a CF on a macbook.....wtf.....
Using these instructions on the wiki worked fine for me. I use a PS3 controller but there are a ton of people gaming with their 360 controllers on their macbooks so it shouldn't be too hard to get it to work.
dwaddsy wrote:can't get the terminal to work either. I followed the instructions and typed in terminal exactly what was told in the readme.text and this is what it keeps doing.
Two problems here:
1) You don't have the client checked out into the directory that you are trying to use.
2) The second command is weird. You probably meant

Code: Select all

python cfclient.py
Although it wont work because you're not in the right directory.

zak
Beginner
Posts: 24
Joined: Thu Jun 06, 2013 6:53 am

Re: How To Fly CF with Android & Macbook?

Post by zak » Mon Jun 10, 2013 10:49 am

First of all, about the updates. The updates in the picture you posted are for the actual Linux OS you're running - the 'hg pull && hg update' command just updates the Crazyflie client, not the actual operating system. You can install the operating system updates if you like, but it's not necessary to get the Crazyflie running.

To clarify what smiler wrote, there are two commands you need in the virtual machine's terminal. I didn't explain what they were used for properly I'm afraid - hopefully the following makes a bit more sense.

Code: Select all

cd projects/crazyflie-pc-client
This command changes directory to the folder that contains the client.

Code: Select all

python bin/cfclient
This command tells python to run the program 'cfclient' that's located in the 'bin' directory.

We could actually combine these by running:

Code: Select all

python projects/crazyflie-pc-client/bin/cfclient
This tells python exactly where the cfclient file is and so it'll run straight away.

Hopefully using these commands will get you back launching the cfclient again, which brings us to the next point. Once you've managed to launch the client, you need to click the 'connect' button in the top left. This will access the Crazyradio and should, if the Crazyflie is switched on, give you at least one entry starting with 'radio://'. Connect to that and you should be able to see the horizon move!
Connect.png
A quick note: please check the thrust setting before connecting to the Crazyflie. If your controller hasn't been connected properly, the desired thrust value can be set to 80% when you connect, which will cause your flie to rocket upwards without you meaning it to! It's happened to me before - the photo below shows what I mean.
Danger.png
Last edited by zak on Mon Jun 10, 2013 11:26 am, edited 2 times in total.

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 » Mon Jun 10, 2013 10:54 am

zak wrote:you need to click the 'connect' button in the top right
--> top left
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107

zak
Beginner
Posts: 24
Joined: Thu Jun 06, 2013 6:53 am

Re: How To Fly CF with Android & Macbook?

Post by zak » Mon Jun 10, 2013 11:27 am

foosel wrote:--> top left
Whoops! Fixed, thanks foosel!

dwaddsy
Beginner
Posts: 25
Joined: Thu May 09, 2013 5:57 am

Re: How To Fly CF with Android & Macbook?

Post by dwaddsy » Tue Jun 11, 2013 7:01 am

Thank you. So far I can make the thrust etc move with my xbox controller however the crazyflie is non responsive. Yes it has juice and the lights are flashing but no response. I did notice that in the assembly video it did not mention this part that I have in the picture. Is this the reason why the CF is not moving?

Any thoughts on why my CF is non responsive?
Attachments
Screen shot 2013-06-10 at 11.59.31 PM.png
Screen shot 2013-06-10 at 11.59.31 PM.png (36.78 KiB) Viewed 3734 times

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 » Tue Jun 11, 2013 8:26 am

This part is not needed for the CF to function (it's a debug connector so to say and just added for convencience if you want to develop stuff on the CF platform)

Are you sure you have selected the "radio:" entry for connecting and are connected (see the description by zak again)? If you click on the "Console" tab, what does it say in there when you have your CF connected?
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107

atomicdog
Expert
Posts: 105
Joined: Tue Mar 12, 2013 2:50 am
Location: San Diego

Re: How To Fly CF with Android & Macbook?

Post by atomicdog » Tue Jun 11, 2013 8:31 am

dwaddsy wrote:Thank you. So far I can make the thrust etc move with my xbox controller however the crazyflie is non responsive. Yes it has juice and the lights are flashing but no response. I did notice that in the assembly video it did not mention this part that I have in the picture. Is this the reason why the CF is not moving?

Any thoughts on why my CF is non responsive?
The picture isn't very clear but it looks like just the ten pin header for JTAG and/or Add-on communication, so it won't effect the operation of the CF.
6-DOF CF | wireless xbox 360 controller

Post Reply