New flow deck and development

Firmware/software/electronics/mechanics
Kiva
Beginner
Posts: 13
Joined: Wed Dec 28, 2016 6:26 pm

New flow deck and development

Post by Kiva »

Hi guys,

I'm really exiting by the new flow deck but before to buy it, I have some questions.

I have seen your new Python example and I have seen your new command send_hover_setpoint.

This one take rad, rad, rad/s rather than classic roll, pitch, yaw. How do you convert classic position to rad, rad, rad/s ?

What is the difference between normal mode and hover mode ?

Why the karma filter is use in the new flow example ?

Finally, I imagine new loggers are available for this deck.
What data are sent by loggers ?

Thanks for your answer and well done for your job :)
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: New flow deck and development

Post by arnaud »

Hi,

The hover mode is a velocity control for X/Y and position control for Z. So you can send meter/second for X/Y and meters for Z. The yaw is controlled in degree per second. This is what is done in this example: https://github.com/bitcraze/crazyflie-l ... ync.py#L66. In the line I linked the setpoint is 0.5m/s forward and 36 degree/s yaw rotation at 40cm height, running that for 10 seconds makes the Crazyflie complete a circular trajectory.

In normal mode you will need to send raw thrust and angles, the hover mode is an autonomous mode where you can set velocity and height instead. The thrust and roll/pitch angles are then controlled by the Crazyflie control loop.

The Kalman filter is used because it is the only estimator implemented in the Crazyflie that can estimate horizontal velocity. We have implemented an automatic estimator switch so that you do not have to care about which filter is used: just start the Crazyflie with the flow deck inserted and it works.

The data the Crazyflie is getting from the flow deck is height measurement and optical flow data. The optical flow outputs delta X and delta Y in 'tick'. These raw data are used by the kalman filter to estimate height and velocity of the Crazyflie. All these data are available as log variables.
Kiva
Beginner
Posts: 13
Joined: Wed Dec 28, 2016 6:26 pm

Re: New flow deck and development

Post by Kiva »

Thanks for your quick and your precise answer :)
Kiva
Beginner
Posts: 13
Joined: Wed Dec 28, 2016 6:26 pm

Re: New flow deck and development

Post by Kiva »

Hi,

I received my flow deck and I have a problem:

I plug the flow deck, I flash the CF with the latest firmware and I update the CF client but I don't have the hover mode as the image shown.

Here is the console output:
SYS: ----------------------------
SYS: Crazyflie 2.0 is up and running!
SYS: Build 0:ab6d531c7ca7 (2017.06) CLEAN
SYS: I am 0x32313338323551122A0051 and I have 1024KB of flash!
CFGBLK: v1, verification [OK]
DECK_DRIVERS: Found 10 drivers
DECK_INFO: Found 1 deck memory.
DECK_CORE: 1 deck enumerated
Motion chip is: 0x49
si pihc noitoM: 0xB6
MPU9250 I2C connection [OK].
AK8963 I2C connection [OK].
LPS25H I2C connection [OK].
ESTIMATOR: Using estimator 2
EEPROM: I2C connection [OK].
AK8963: Self test [OK].
DECK_CORE: Deck 0 test [OK].
SYS: Free heap: 15344 bytes

What I have missed to have the hover mode ?

Thanks.
Attachments
Capture d’écran 2017-08-10 à 16.09.25.png
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: New flow deck and development

Post by arnaud »

Thanks for the detailed report :-). It seems that you are not using the latest client since the hover mode is not listed. How did you update the client?
nanobot9000
Beginner
Posts: 26
Joined: Mon Apr 11, 2016 4:33 pm

Re: New flow deck and development

Post by nanobot9000 »

Any plans to add "Hover Mode" to the iOS app? That would make controlling it via the app so much easier!

Thanks,
Kiva
Beginner
Posts: 13
Joined: Wed Dec 28, 2016 6:26 pm

Re: New flow deck and development

Post by Kiva »

@arnaud: I tried two methods:
I download the latest release from GitHub.
I get the latest version (master) from GitHub and I build it.

With the lib python, all work fine so it seems a problem with the client as you said.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: New flow deck and development

Post by arnaud »

What does the about box of the cfclient says as version? Sometime an old version gets stuck in the python package manager, you can try to uninstall the client with pip many times (and with sudo) before re-installing it.

@nanobot9000 my main problem will (as usual) be how to design the GUI in a nice and safe way to switch flight mode. Feel free to post a ticket on the ios app github project, we can talk about it there.
Kiva
Beginner
Posts: 13
Joined: Wed Dec 28, 2016 6:26 pm

Re: New flow deck and development

Post by Kiva »

I uninstall cfclient and cflib with pip.

I re-install they from master:
pip3 install -e .
Obtaining file:///Users/Xebia/xebia/crazyflie/crazyflie-lib-python
Requirement already satisfied: pyusb>=1.0.0b2 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from cflib==0.1.3)
Installing collected packages: cflib
Running setup.py develop for cflib
Successfully installed cflib
pip3 install -e .
Obtaining file:///Users/Xebia/xebia/crazyflie/crazyflie-clients-python
Requirement already satisfied: pysdl2 in /Users/Xebia/crazyenv/lib/python3.6/site-packages (from cfclient===2016.4-103-g9b95704-modified)
Collecting cflib>=0.1.1 (from cfclient===2016.4-103-g9b95704-modified)
Using cached cflib-0.1.3-py2.py3-none-any.whl
Requirement already satisfied: appdirs==1.4.0 in /Users/Xebia/crazyenv/lib/python3.6/site-packages (from cfclient===2016.4-103-g9b95704-modified)
Requirement already satisfied: pyzmq in /Users/Xebia/crazyenv/lib/python3.6/site-packages (from cfclient===2016.4-103-g9b95704-modified)
Requirement already satisfied: pyqtgraph>=0.10 in /Users/Xebia/crazyenv/lib/python3.6/site-packages (from cfclient===2016.4-103-g9b95704-modified)
Requirement already satisfied: pyusb>=1.0.0b2 in /Users/Xebia/crazyenv/lib/python3.6/site-packages (from cflib>=0.1.1->cfclient===2016.4-103-g9b95704-modified)
Requirement already satisfied: numpy in /Users/Xebia/crazyenv/lib/python3.6/site-packages (from pyqtgraph>=0.10->cfclient===2016.4-103-g9b95704-modified)
Installing collected packages: cflib, cfclient
Running setup.py develop for cfclient
Successfully installed cfclient cflib-0.1.3
When I run cfclient, I get this version:
Cfclient
Cfclient version: 2016.4-103-g9b95704-modified
System: darwin
Python: 3.6.0
Qt: 5.7.1
PyQt: 5.7.1

Interface status
radio: Crazyradio version 0.53
serial: None
udp: None
UsbCdc: No information available

Input readers
PySDL2 (0 devices connected)

Input devices
None

Crazyflie
Connected: None
Firmware: None
Sensors found
Sensors tests
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: New flow deck and development

Post by arnaud »

This looks old, I think I know what might be happening: are you on the develop branch? If so switch to the Master branch, we have moved development to the master branch a little while back.
Post Reply