How To Fly CF with Android & Macbook?

Discussions and questions about the Crazyflie Nano Quadcopter
zak
Beginner
Posts: 24
Joined: Thu Jun 06, 2013 6:53 am

Re: How To Fly CF with Android & Macbook?

Post by zak »

Can you post a screenshot or tell us what controller the client is using? It's listed in the bottom left of the client window. For example, if you look at the pictures in my earlier post, they say 'Using [Virtualbox USB Tablet] with config [PS3_Mode_3]'. It sounds like you're using the Xbox wireless receiver already, so the problem might be linking the controller and receiver. I'm not sure how Xbox controllers work - with the PS3 controller, I have to push the PS button in the centre before the client accepts commands. Does the Xbox controller have a similar button, perhaps the one with the lights that you mentioned?

One option (taken from this Ask Ubuntu thread) might be to use the following two commands in a terminal window:

Code: Select all

sudo apt-get install --install-recommends jstest* joystick xboxdrv
This will install the program we need to test your controller. Next, use:

Code: Select all

jstest-gtk
This will open a window where you can select and test your controller.

Give it a go and let us know how you go.
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 »

dwaddsy wrote:I have spent countless hours trying to go through the virtual box and figure out how to make the settings work but to no avail. I really am at a complete loss how this is so complicated and how there are no answers.

I feel at this point I might have to sell my CF =(. I really wanted to fly this so bad. I waited for months to receive my CF and I went out and bought an Xbox Controller. I put the CF together with the video and the Virtual box is responding to the Xbox Controller. The CF is responding to the Virtual box but I cannot get the Xbox to control the CF. Someone must know something.

I guess with this failure after tomorrow I will have to sell my CF. I wish I could use it...
Dwaddsy, you are being a bit unfair there... many many people in this thread have been really reaching out to you, trying to help, to solve your issues, to provide answers and step-by-step instructions including pictures. Declaring this as "No answers" really isn't fair to them :) I'm sorry I can't further help myself, but I just don't know Mac-stuff, so I would be more misleading than anything, but from my perspective you are getting really close to have it working, now would really be the wrong time to give up.

Let's summarize the current state and the next step on your end to take to provide answers back to your helpers here:
  • Your controller is working and responding in the "configure input device" dialog in the Crazyflie Client, at least that's what I take from your "everytime I moved anything on my controller I was able to get a reaction". => That is good, your controller is working and can be accessed! The blinking LEDs on it are -- at least as far as I know -- indeed just caused by the driver but don't influence actual operation
  • Your client is connected to your CF and the UI responds to the CF's movements. => That is good too, your Crazyradio is working and can be accessed!
  • :?: Open question for you to answer: Looking into the lower left corner (status bar) of your Crazyflie Client software, when you are connected to your CF and have the controller attached, what exactly does it say there?
  • :?: Open question for you to answer: When you power up your Crazyflie, do the four motors rotate? Each should give a tiny rotation, if any of them do not rotate we'll have to investigate why!
  • :?: Open question for you to answer: When you power up your Crazyflie, take note of the blinking pattern from the red and green LEDs on the CF and compare it to this wiki page. Does the blinking pattern match "Tests passed" or "Tests failed"?
We are all really trying to get your CF into the air (with you as the pilot!) but you need to do your part too. Just complaining that it doesn't work and that nobody wants to help you and not providing specific feedback to the questions asked from you by the people who actually are trying to help you is just frustrating for every party involved. So please: help us to help you!
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 »

zak wrote:Can you post a screenshot or tell us what controller the client is using? It's listed in the bottom left of the client window. For example, if you look at the pictures in my earlier post, they say 'Using [Virtualbox USB Tablet] with config [PS3_Mode_3]'. It sounds like you're using the Xbox wireless receiver already, so the problem might be linking the controller and receiver. I'm not sure how Xbox controllers work - with the PS3 controller, I have to push the PS button in the centre before the client accepts commands. Does the Xbox controller have a similar button, perhaps the one with the lights that you mentioned?

One option (taken from this Ask Ubuntu thread) might be to use the following two commands in a terminal window:

Code: Select all

sudo apt-get install --install-recommends jstest* joystick xboxdrv
This will install the program we need to test your controller. Next, use:

Code: Select all

jstest-gtk
This will open a window where you can select and test your controller.

Give it a go and let us know how you go.
Hello thanks for your post. I went into the terminal and typed what you told me. It just allowed me to type in the commands but there was/is no change in anything. Not sure what it was suppose to do. Here is a capture of me putting in the code
Attachments
Screen shot 2013-06-14 at 11.15.18 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 »

foosel wrote:
dwaddsy wrote:I have spent countless hours trying to go through the virtual box and figure out how to make the settings work but to no avail. I really am at a complete loss how this is so complicated and how there are no answers.

I feel at this point I might have to sell my CF =(. I really wanted to fly this so bad. I waited for months to receive my CF and I went out and bought an Xbox Controller. I put the CF together with the video and the Virtual box is responding to the Xbox Controller. The CF is responding to the Virtual box but I cannot get the Xbox to control the CF. Someone must know something.

I guess with this failure after tomorrow I will have to sell my CF. I wish I could use it...
Dwaddsy, you are being a bit unfair there... many many people in this thread have been really reaching out to you, trying to help, to solve your issues, to provide answers and step-by-step instructions including pictures. Declaring this as "No answers" really isn't fair to them :) I'm sorry I can't further help myself, but I just don't know Mac-stuff, so I would be more misleading than anything, but from my perspective you are getting really close to have it working, now would really be the wrong time to give up.

Let's summarize the current state and the next step on your end to take to provide answers back to your helpers here:
  • Your controller is working and responding in the "configure input device" dialog in the Crazyflie Client, at least that's what I take from your "everytime I moved anything on my controller I was able to get a reaction". => That is good, your controller is working and can be accessed! The blinking LEDs on it are -- at least as far as I know -- indeed just caused by the driver but don't influence actual operation
  • Your client is connected to your CF and the UI responds to the CF's movements. => That is good too, your Crazyradio is working and can be accessed!
  • :?: Open question for you to answer: Looking into the lower left corner (status bar) of your Crazyflie Client software, when you are connected to your CF and have the controller attached, what exactly does it say there?
  • :?: Open question for you to answer: When you power up your Crazyflie, do the four motors rotate? Each should give a tiny rotation, if any of them do not rotate we'll have to investigate why!
  • :?: Open question for you to answer: When you power up your Crazyflie, take note of the blinking pattern from the red and green LEDs on the CF and compare it to this wiki page. Does the blinking pattern match "Tests passed" or "Tests failed"?
We are all really trying to get your CF into the air (with you as the pilot!) but you need to do your part too. Just complaining that it doesn't work and that nobody wants to help you and not providing specific feedback to the questions asked from you by the people who actually are trying to help you is just frustrating for every party involved. So please: help us to help you!
I appreciate everyone stepping in to help. I am also admitting I am very upset as I have spent many hours on this. I understand this is not a toy but it is getting ridiculous and extremely frustrating..

Answers: Yes all four motors rotate
Answer: blue is sold, green is solid but looks like it is receiving information similar to old school computer tower light and the red flashes
Attachments
Screen shot 2013-06-14 at 11.24.04 PM.png
Screen shot 2013-06-14 at 11.20.55 PM.png
Screen shot 2013-06-14 at 11.21.27 PM.png
Screen shot 2013-06-14 at 11.21.17 PM.png
Screen shot 2013-06-14 at 11.15.18 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 »

So nobody has been able to use the XBox 360 controller the PS controller with a Macbook?
dwaddsy
Beginner
Posts: 25
Joined: Thu May 09, 2013 5:57 am

Re: How To Fly CF with Android & Macbook?

Post by dwaddsy »

There must be something wrong with the program. When I configure my Xbox 360 controller to assign movements to pitch,thrust etc it responds fine. I identify which choice I am setting it for which I have done [xbox360_mode1]. But when i go back to the main window I can't get the pitch,thrust to move when I move the controller.
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:There must be something wrong with the program. When I configure my Xbox 360 controller to assign movements to pitch,thrust etc it responds fine. I identify which choice I am setting it for which I have done [xbox360_mode1]. But when i go back to the main window I can't get the pitch,thrust to move when I move the controller.
It sounds like you're really close dwaddsy - have you been saving the profile you create once you've configured all of the axes? Once they're working in the config window, you need to change the profile name (something like 'my controller' or similar), then hit the save button before they'll work in the client itself.

Also, I should say that the commands I gave you earlier need to be put into a terminal window when the client isn't running. While the client is running, the terminal is showing information happening 'behind the scenes' - any commands you put in won't be processed by the virtual machine.
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 »

You seem to be running into this problem for which there is a solution here.

I can't test out the steps completely myself right now (my own controller refuses to be recognized by Virtualbox as it is captured by the host system and all USB filters in the world don't seem to prevent that...), I'll try to walk you through the steps. It is important that you do them in the order I line out here, and that you check the command's outputs against the described expected output.

1. First open the Terminal in your VM by double-clicking the terminal icon on the desktop.

2. Enter the command sudo -s and hit Enter. You will be asked for a password, enter crazyflie for that and hit Enter. It should now say "root@bitcraze-ubuntu" at the beginning of your command prompt (it previously said "bitcraze@bitcraze-ubuntu")

3. Enter the command echo "blacklist xmap" > /etc/modprobe.d/blacklist.conf and hit Enter. Nothing visible should happen.

4. Enter the command cat /etc/modprobe.d/blacklist.conf and hit Enter. It should show exactly one line, blacklist xmap

5. Enter the command rmmod xmap and hit Enter. If you do not happen to have your XBox controller plugged in, this might show ERROR: Module xmap does not exist in /proc/modules, which in this case is ok. Otherwise it should show nothing.

6. Enter the command apt-get install xboxdrv and hit Enter. It should probably say something like The following NEW packages will be installed followed by the name xboxdrv in the new line, it might also say something like xboxdrv is already the newest version or maybe something along the lines of xboxdrv now being upgraded. All of these are ok.
Ubuntu Bitcraze [wird ausgeführt] - Oracle VM VirtualBox_2013-06-15_14-32-41.png
Now follow the steps I couldn't test myself due to the issues stated above, I'll do my best to nevertheless describe what you'll need to do.

7. Make sure your controller is plugged in and on, then enter the command xboxdrv and hit Enter. You should see some message about xboxdrv having found your controller. Try moving the sticks and pressing the buttons, that should write stuff on the screen. If you get feedback, great! Leave the terminal open for now.

8. Plugin your Crazyradio dongle (if it isn't already). Open another Terminal and in that start your crazyflie client.

9. Enter device configuration, selected the one that says something along the lines of "Xbox 360 controller (userspace driver)". Create new mapping for that, name it something like "xboxdrv", save, exit device configuration.

10. Make sure that under Input device > Devices in the menu you see the "Xbox 360 controller (userspace driver)" and that it is selected.

11. Make sure that under Input device > Mappings in the menu you see the "xboxdrv" mapping you just created and that it is selected.

12. Test the controller (do not connect the CF yet!). When you push the sticks you should see the values in the "Target" column under the horizon and the Thrust-bar change.

13. Power up the Crazyflie on a plane surface, wait until the motors rotated and the red LED is blinking steadily at about 1Hz.

14. Connect the Crazyflie, test if the Horizon is responding when you move it around.

15. Place the CF on a plane surface with 50cm/~2ft space to all sides, take your controller, slowly :!: increase thrust until the motors start spinning. If that works, congratulations, now it's time to learn flying. Please report back though, we'll need to make sure it does work in the future as well (basically you'll have to start xboxdrv via sudo xboxdrv in a separate terminal, alternatively this can be done automatically when the controller is detected).
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:You seem to be running into this problem for which there is a solution here.

I can't test out the steps completely myself right now (my own controller refuses to be recognized by Virtualbox as it is captured by the host system and all USB filters in the world don't seem to prevent that...), I'll try to walk you through the steps. It is important that you do them in the order I line out here, and that you check the command's outputs against the described expected output.

1. First open the Terminal in your VM by double-clicking the terminal icon on the desktop.

2. Enter the command sudo -s and hit Enter. You will be asked for a password, enter crazyflie for that and hit Enter. It should now say "root@bitcraze-ubuntu" at the beginning of your command prompt (it previously said "bitcraze@bitcraze-ubuntu")

3. Enter the command echo "blacklist xmap" > /etc/modprobe.d/blacklist.conf and hit Enter. Nothing visible should happen.

4. Enter the command cat /etc/modprobe.d/blacklist.conf and hit Enter. It should show exactly one line, blacklist xmap

5. Enter the command rmmod xmap and hit Enter. If you do not happen to have your XBox controller plugged in, this might show ERROR: Module xmap does not exist in /proc/modules, which in this case is ok. Otherwise it should show nothing.

6. Enter the command apt-get install xboxdrv and hit Enter. It should probably say something like The following NEW packages will be installed followed by the name xboxdrv in the new line, it might also say something like xboxdrv is already the newest version or maybe something along the lines of xboxdrv now being upgraded. All of these are ok.
The attachment Ubuntu Bitcraze [wird ausgeführt] - Oracle VM VirtualBox_2013-06-15_14-32-41.png is no longer available
Now follow the steps I couldn't test myself due to the issues stated above, I'll do my best to nevertheless describe what you'll need to do.

7. Make sure your controller is plugged in and on, then enter the command xboxdrv and hit Enter. You should see some message about xboxdrv having found your controller. Try moving the sticks and pressing the buttons, that should write stuff on the screen. If you get feedback, great! Leave the terminal open for now.

8. Plugin your Crazyradio dongle (if it isn't already). Open another Terminal and in that start your crazyflie client.

9. Enter device configuration, selected the one that says something along the lines of "Xbox 360 controller (userspace driver)". Create new mapping for that, name it something like "xboxdrv", save, exit device configuration.

10. Make sure that under Input device > Devices in the menu you see the "Xbox 360 controller (userspace driver)" and that it is selected.

11. Make sure that under Input device > Mappings in the menu you see the "xboxdrv" mapping you just created and that it is selected.

12. Test the controller (do not connect the CF yet!). When you push the sticks you should see the values in the "Target" column under the horizon and the Thrust-bar change.

13. Power up the Crazyflie on a plane surface, wait until the motors rotated and the red LED is blinking steadily at about 1Hz.

14. Connect the Crazyflie, test if the Horizon is responding when you move it around.

15. Place the CF on a plane surface with 50cm/~2ft space to all sides, take your controller, slowly :!: increase thrust until the motors start spinning. If that works, congratulations, now it's time to learn flying. Please report back though, we'll need to make sure it does work in the future as well (basically you'll have to start xboxdrv via sudo xboxdrv in a separate terminal, alternatively this can be done automatically when the controller is detected).
Thank you for the steps. Unfortunately I got stuck at step 9. It is not detecting my xbox 360 controller's movements now. I attached a snapshot of where I got stuck. Before it was responsive but since I did the steps 1 through 8 it is not responsive anymore.
Attachments
Screen shot 2013-06-15 at 9.20.27 PM.png
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 »

you got feedback though in step 7? and left the terminal open and the program running?
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
Post Reply