Page 1 of 1

flowdeck with a smartphone as a remote controller

Posted: Sat Feb 10, 2018 10:17 pm
by yonim
Hi,

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

Thank you, Yoni

Re: flowdeck with a smartphone as a remote controller

Posted: Mon Feb 12, 2018 2:02 pm
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.

Re: flowdeck with a smartphone as a remote controller

Posted: Tue Feb 13, 2018 11:50 am
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.

Re: flowdeck with a smartphone as a remote controller

Posted: Wed Feb 14, 2018 11:24 am
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.

Re: flowdeck with a smartphone as a remote controller

Posted: Wed Feb 14, 2018 11:48 am
by yonim
Hi Arnaud,

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

Thank you, Yoni.

Re: flowdeck with a smartphone as a remote controller

Posted: Thu Feb 15, 2018 10:39 am
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 :-).

Re: flowdeck with a smartphone as a remote controller

Posted: Thu Feb 15, 2018 11:31 am
by yonim
Hi Arnaud,

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

Thank you, Yoni.

Re: flowdeck with a smartphone as a remote controller

Posted: Thu Feb 15, 2018 11:49 am
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.

Re: flowdeck with a smartphone as a remote controller

Posted: Thu Feb 15, 2018 11:56 am
by yonim
Ok, thank you.