flowdeck with a smartphone as a remote controller

Discussions about quadcopters/multi-rotors
Post Reply
yonim
Beginner
Posts: 8
Joined: Sat Feb 10, 2018 10:12 pm

flowdeck with a smartphone as a remote controller

Post by yonim »

Hi,

Can we use the flowdeck with a smartphone as a remote controller instead of a gamepad?

Thank you, Yoni
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: flowdeck with a smartphone as a remote controller

Post by arnaud »

Hi Yoni,

not out of the box. There is not implementation for the flow deck in the Android of iOS client for now.

Though, it would not be very hard to hack the code to make the client only work with the flow deck, sending hover setpoint packets. If you are initerested in either Android or iOS developement I woud gladly guide you.

Otherwise, you can create a ticket on the Android or iOS client repos to ask for the functionality.
yonim
Beginner
Posts: 8
Joined: Sat Feb 10, 2018 10:12 pm

Re: flowdeck with a smartphone as a remote controller

Post by yonim »

Hi Arnaud,

Please guide me on hacking the code to make the client only work with the flow deck.
Are the code changes only on the drone's cpu?

Thank you, Yoni.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: flowdeck with a smartphone as a remote controller

Post by arnaud »

The code changes are in the client itself, the drone has all the code and functionality already implemented :-).

Sounds great! What client are you interested in hacking? The android or the iOS client?

In both case, what you need to do is to send an hover setpoint packet instead of a commander packet.
yonim
Beginner
Posts: 8
Joined: Sat Feb 10, 2018 10:12 pm

Re: flowdeck with a smartphone as a remote controller

Post by yonim »

Hi Arnaud,

We would like to work with an Android client.
Can you instruct us?

Thank you, Yoni.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: flowdeck with a smartphone as a remote controller

Post by arnaud »

The android client has a loop that sends commander packet, this packets contains roll pitch yaw thrust: https://github.com/bitcraze/crazyflie-a ... .java#L677

What you need to do is to create two new generic commander CRTP packets, the stop packet and the hover packet. The CRTP packets are implemented there: https://github.com/bitcraze/crazyflie-a ... e/lib/crtp. The format of the packet is documented in the wiki: https://wiki.bitcraze.io/doc:crazyflie: ... c_setpoint. You can take the commander packet as an example of how to implement new type of packets.

The idea is to replace the part that sends the commander packet, with code that either sends the stop packet when the on-screen joystick are not touched, or an hover packet with height, velocity_x, velocity_right, yaw. If you want similar behavior to the PC client implementation, you will need to keep a variable with the current height setpoint and update this variable, increasing or decreasing it, with the position of the thrust joystick axis. For reference, this is how it is implemented in the python PC client: https://github.com/bitcraze/crazyflie-c ... #L443-L463

I hope this is enough tips to get you started :-).
yonim
Beginner
Posts: 8
Joined: Sat Feb 10, 2018 10:12 pm

Re: flowdeck with a smartphone as a remote controller

Post by yonim »

Hi Arnaud,

Isn't there an Android app I could just download and install on my phone?

Thank you, Yoni.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: flowdeck with a smartphone as a remote controller

Post by arnaud »

Yes there is an android app, but as I told you before the Android app does not yet support the flow deck but it is open source and it can be added quite easily in the code.

Though you require at least a minimal knowledge of Android development, with the information from my last post you should be able to build your own version of the client with Flow support.
yonim
Beginner
Posts: 8
Joined: Sat Feb 10, 2018 10:12 pm

Re: flowdeck with a smartphone as a remote controller

Post by yonim »

Ok, thank you.
Post Reply