LPS configuration

All discussions related to the Loco Positioning system
mn14jg
Beginner
Posts: 14
Joined: Fri Jan 26, 2018 12:24 pm

LPS configuration

Post by mn14jg »

Hi,

I am an undergraduate student at the University of Leeds, I have never used python or any similar code before, I have never used Ubuntu before and I have no experience using Linux, my project is to use the LPS to fly 4 Crazyflies together.

I'm following the steps on https://www.bitcraze.io/getting-started ... ng-system/ and have successfully:

- Downloaded & updated each anchor node
- Configured the anchor nodes to have ID's
- Powered the nodes and fixed them in our test cage using the 3D printed stands supplied

However, when I launch the Crazyflie VM and launch the Crazyflie client (as described on the instructions), and select the Loco positioning tab, I get the screen in the attachment 'Loco tab'.

Also, the VM seems to grind to a halt and become unusable, the code in the terminal is updating very quickly and is unreadable to my not-so-well-trained eye for code.

My intuition tells me that the issue I am encountering is happening because I am configuring the anchor nodes in Windows and then trying to run/use them in Linux. I have tried to follow the instructions on https://github.com/bitcraze/lps-tools#r ... nstruction however I feel I am too inexperienced with Linux/Python to follow them correctly, see my attempt in the attachment 'LPS Installer'

Please help! Many thanks in advance.
Josh
MEng Aeronautical & Aerospace Engineering (Year 3)
University of Leeds
Attachments
LPS installer.PNG
Loco tab.PNG
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: LPS configuration

Post by arnaud »

Hi,

The problem is that there is a bug in the VM configuration, it is not using the latest version of the client. See this answer: viewtopic.php?f=5&t=2812#p14010

The pip commands where not required for the VM (since it already have the client installed), but anyway they need to be run in the crazyflie clients folder (you need to 'cd' in the project folder).

You can also use the client on windows directly: https://github.com/bitcraze/crazyflie-c ... /releases/. It will work with the LPS too.

If all you want is to work with python, it is fairly easy to setup the dev environment directly on widows. See for example the getting started with flow: https://www.bitcraze.io/getting-started ... ne-bundle/. Developing the Crazyflie firmware is a bit harder to setup on Windows and then the VM is a good dev environment to get started quickly.
mn14jg
Beginner
Posts: 14
Joined: Fri Jan 26, 2018 12:24 pm

Re: LPS configuration

Post by mn14jg »

Hi Arnaud, thanks for your reply.

I followed the instructions on the link you posted, I think the client is now using the latest version. The LPS tab on the client shows a dashboard similar to the instructions I was originally following and the Crazyflie location is updating, however:

- The error in the command prompt hasn't changed, furthermore this is still causing horrendous FPS/reaction times that are unusable until you manage to select the flight control tab.

- The location of the Crazyflie seems to eventually increase to X=10.00, Y=10.00 if you move it in any direction, i.e. the coordinates seem to only work in one direction.

- In addition to this, I now cannot fly my Crazyflie using my python code because of the error displayed in the attachment after trying to run 'josh2.py'. This was in full working order before - it is just a simple code that makes the Crazyflie take-off, hold altitude and then land. Please note that it does not work even if I don't have the Loco anchors powered or the Loco expansion deck on the Crazyflie itself, as well as not having the LPS tab open on the client.

Furthermore, I downloaded the Windows version of the client but I cannot get this to run for some reason, I have tried running as administrator etc and I have python downloaded on Windows. (The command prompt pops open but then closes immediately).

Thanks
Josh
Attachments
After changing.PNG
After changing LPS.PNG
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: LPS configuration

Post by arnaud »

Hi,

- I see the error too, it does not seem to cause functional problems. Though the GUI is pretty slow when the loco positioning tab is open. Closing the LPS tab, resolve the slowness problem. The only solution I have right now is to open the tab only when needed.

- This is the Kalman filter diverging. It means that there is no position measurement pushed into to the Kalman filter. Most likely because you have not setup the anchor position so no anchor is used. You can set the anchor position using the LPS tab.

- This variable does not exist anymore in the Crazyflie. You can use "stateEstimate.z" instead

What version of the windows client did you download and on what windows are you running it?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: LPS configuration

Post by arnaud »

An update: to remove the LPS tab warnings and performance problem you can run in a console:

Code: Select all

cd projects/crazyflie-clients-python
sudo pip3 install -e . --upgrade
It will take a while (took about 10-20min for me), but it will install the latest version of all the python dependencies and this solves the problem.

It will be solved in future build/version of the VM. I created an issue for it: https://github.com/bitcraze/bitcraze-vm/issues/33
mn14jg
Beginner
Posts: 14
Joined: Fri Jan 26, 2018 12:24 pm

Re: LPS configuration

Post by mn14jg »

Thanks for your reply.

I am running the upgrade now, I will be able to test it later this afternoon.

I am running Windows 10 home, version 1709 and the latest client download from https://github.com/bitcraze/crazyflie-c ... n/releases - cfclient-win32-install-2018.01.3.exe.

I will try to write the positions to the anchors this afternoon.

Thanks
Josh
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: LPS configuration

Post by arnaud »

Did you upgrade the client from a previous version? I am running the same version of Windows (but pro) and it works here. Can you try to uninstall the client, remove the crazyflie folder from c:\program files (x86)\ and install it again? Maybe there is traces left of an old version of the client.
mn14jg
Beginner
Posts: 14
Joined: Fri Jan 26, 2018 12:24 pm

Re: LPS configuration

Post by mn14jg »

Hi Arnaud,

I have re-downloaded the Windows version of the client and now it seems to be working.

Also, I have had success using the VM after installing the latest python dependencies, the LPS tab is still a little slow (as you described) and the error is still flashing quite rapidly, however it is now usable. I have updated my anchor positions and I am now able to run autonomousSequence.py successfully.

Thanks very much for all your help, I have no more questions (for now!),
Josh
mn14jg
Beginner
Posts: 14
Joined: Fri Jan 26, 2018 12:24 pm

Re: LPS configuration

Post by mn14jg »

I have 2 new questions:

1) RE trying to fly multiple CFs together using LPS. I am getting an error when trying to run swarmSequence.py 'cannot import name 'CachedCfFactory' '. I have found CachedCfFactory in 'swarm.py'. Can't seem to find a mention of this module anywhere on these forums?

2) Running autonomousSequence seems to be inaccurate in z axis (altitude), I have a flow deck - is it possible to use a combination of the flow deck & LPS deck to get accurate autonomous flight? Furthermore, I plan on using both decks for 4 CF's in a swarm sequence.

Thanks
Attachments
CachedCfFactory.PNG
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: LPS configuration

Post by arnaud »

Hi,

1) This is most likely because you run the example from the latest git commit but you run the lib installed from the pypi repos (the latest release). This module has been implemented after the latest release. See this ticket for the command to run the lib from source: https://github.com/bitcraze/crazyflie-l ... /issues/72. You should most likely uninstall the lib first with "pip3 uninstall cflib"

2) Yes it is possible to run flow and LPS together, it works out of the box and improves greatly the Z and x/y accuracy. Though it might cause problem in case of big inconsistency between the LPS measured velocity and the flow measured velocity, this might happen for example if there is noise in the flow measurement. I have not tested it extensively but this is just a heads-up if you see something strange when using both deck together. The Z sensor of the flow deck will be used up to about 1m, over that only the LPS is used.
Post Reply