-
Notifications
You must be signed in to change notification settings - Fork 118
Connecting an external controller
Instead of using the on-screen controls, you can also connect an external controller like a PS3 Controller (or compatible).
There are several possible combinations how this works depending on how you connect to the Crazyflie:
Connection to Crazyflie | Gamepad connection: USB via OTG cable |
Gamepad connection: USB via USB hub |
Gamepad connection: Bluetooth direct (only Sony phones) | Gamepad connection: Bluetooth with root access and SixAxis Controller app |
---|---|---|---|---|
Crazyradio | No | Yes | Yes | Yes |
Bluetooth LE | Yes | Yes | Yes | No |
In addition to the USB OTG cable, you'll also need:
- USB Y-Cable
- USB Hub
- PS3 Controller (or compatible joystick/gamepad)
- Connect a USB Host (OTG) adapter to your Android device
- Connect a USB Y-cable with the USB Host adapter
- Connect a wall-plug with the (red) power plug of the Y-cable (you need external power)
- Connect the upstream port of a USB hub with the socket of the Y-cable
- Plug the Playstation controller and the Crazyradio into the USB hub
- In the Crazyflie Android app, change the controller to game pad
- Preferences button → Controller Settings → Controller
- The Crazyflie Android client should say “Using game pad controller”
- Press the “PS” button and move the analog sticks (the pitch/roll/thrust/yaw on-screen values should change)
In general, you cannot simply connect the Playstation controller to an Android phone, since Sony uses a special Bluetooth stack. It actually does work on certain Sony Xperia phones and tablets (e.g. Z2,Z3), because those phones have native support for connecting to Playstation controllers. With a Sony device you can even connect to the Playstation controller and the Crazyflie via Bluetooth at the same time.
- Go to Settings -> Xperia -> Dualshock3 Wireless Controller
- Start the wizard "How to connect a controller"
- Connect your PS3 controller to the Sony phone/tablet with an USB OTG cable
- At the end of the setup process your PS3 controller should be connected to your phone/tablet wirelessly
If you don't own a Sony phone, you can install the SixAxis Controller app (paid) instead.
Please note: your phone/tablet must be rooted for this to work.
If you use the SixAxis Controller app, you cannot connect to the Crazyflie 2.0 via Bluetooth while you are connected to the PS3 controller via Bluetooth.
- Use the Sixaxis Controller app to pair and connect the Playstation Controller
- You might have to press the “PS” button to activate the Playstation Controller
- In the Crazyflie Android app, change the controller to game pad (if you haven't done so yet)
- Preferences button → Controller Settings → Controller
- Press the “PS” button and move the analog sticks (the pitch/roll/thrust/yaw on-screen values should change)
If you already own a Taranis X9D (Plus) RC transmitter and want to use it as a controller, it can be configured to work with the Crazyflie Android client.
Fortunately the transmitter is able to act as an USB Joystick (see https://opentx.gitbooks.io/manual-for-opentx-2-2/radio_joystick.html).
You should create a new model when using the Taranis as an USB Joystick:
- Turn off both internal and external TX modules
- Configure the thrust input (Weight 50% and Offset 50%)
- otherwise the full travel of the axis assigned to thrust cannot be used
- Servos menu
- invert Thrust (CH1)
- invert Eleron (CH3)
Here are the necessary steps to configure the Crazyflie Android client:
- Turn on the Taranis
- Connect the Taranis with a USB cable and a USB host (OTG) adapter to the Android device
- The Taranis screen should display a USB symbol when it's connected
- Check that all sticks are in center position
- Open the Crazyflie Android client
- Go to Preferences → Controller Settings and switch Controller to Gamepad
- Go to "Gamepad axis and button mapping" and configure the following axes
- Right analog X axis should be AXIS_Y
- Right analog Y axis should be AXIS_Z
- Left analog X axis should be AXIS_RX
- Left analog Y axis should be AXIS_X
- Depending on the mode you are using on the Taranis (Mode 1 or 2), set the Mode in the Android app
- Preferences → Flight control settings → Mode
- Before connecting to the Crazyflie, check that all axes are working (values should change in the Android app)
- Attention: Always make sure that the thrust stick is all the way down before connecting to the Crazyflie!
- Connect to the Crazyflie over Bluetooth
- If you have a Crazyflie 1 you need to use a (powered) USB hub to connect both the Taranis RC transmitter and the Crazyradio USB dongle
- Fly the Crazyflie with the Taranis and have fun! :D