LPS configuration

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

Re: LPS configuration

Post by mn14jg » Sun Feb 25, 2018 11:24 am

Thanks Arnaud,

1) This fix worked, flying 2 CF's with swarmSequence.py worked, however I couldn't seem to replicate the results, the behaviour was very odd. I managed to get 2 to take-off, hover for a second and then land perfectly but on a second run one of the CF's fly totally off-course and crashed 1/2m to the left as soon as it took off. I didn't amend the code between these two runs and several more successive tries only resulted in failures again. I am investigating the effect of changing the coordinates around, I have set my LPS system up so that X=Y and Y=X relative to the template - could this be causing the issues even after I've changed x1,2,3 to y and vice versa?

Further to this, which line of the code amends the time that each line of the sequence executes for? (same question for autonomousSequence), can't find an obvious variable anywhere.

2) I will test the flow deck when I have a better floor pattern - we are currently using matt black rubber which causes a strange wobble - found similar issues elsewhere and concluded that we need a more diverse floor - a test outside the lab on laminate wood seemed to work very well.

arnaud
Bitcraze
Posts: 1752
Joined: Tue Feb 06, 2007 12:36 pm

Re: LPS configuration

Post by arnaud » Sun Feb 25, 2018 12:08 pm

Are you always starting your Crazyflies facing X?

I am not sure I understand the question about the coordinate system. The only thing you need to make sure is that your coordinate system is right-handed with Z up. As long as this is the case and you are starting the Crazyflies facing X, you can setup the coordinate system the way you want.

mn14jg
Beginner
Posts: 14
Joined: Fri Jan 26, 2018 12:24 pm

Re: LPS configuration

Post by mn14jg » Mon Feb 26, 2018 10:15 am

My coordinate system is right-handed, it's just rotated 90deg relative to the one you provided - in swarmSequence.py, you have a diagram of the nodes and starting positions at the start of the code, these don't match my orientation.

I have altered them to match my lab setup and this did initially yield a perfect result, I just couldn't replicate it! I'll try rotate the CF's themselves and update.
Attachments
LPS orientation.PNG
Lab orientation.PNG

mn14jg
Beginner
Posts: 14
Joined: Fri Jan 26, 2018 12:24 pm

Re: LPS configuration

Post by mn14jg » Fri Mar 02, 2018 1:52 pm

I have tried 2 CF's facing X and this had a slightly better success rate, but still on more than half of test flights one (usually the second) would either stay stationary or fly sidewards and crash into our cage.

I have also tried with 3 CF's twice:

Test 1
- CF 1 took off, hovered and landed where it began
- CF 2 skidded sideways along the floor
- CF 3 stayed stationary

Test 2
All three CF's took off and hit different sides of the cage

I didn't change anything between each test flight again, has anyone else seen similar results?

Also, I seemed to have lost the ability to perform autonomousSequence.py with a single CF, terminal does not display errors, the CF just does not move, terminal stuck on
'Waiting for estimator to find position'

Question:
Does this have anything to do with switching the anchor nodes to TDoA in the client? (Does this affect the Python script flights?)

Can you fly autonomousSequence whilst in TDoA mode? If so then I cannot think of what could be stopping the CF from flying..!

arnaud
Bitcraze
Posts: 1752
Joined: Tue Feb 06, 2007 12:36 pm

Re: LPS configuration

Post by arnaud » Mon Mar 05, 2018 12:17 pm

A lot of what you are describing look like the Crazflies do not have position update from the system.

When it comes to control script, there is not difference between TDoA and TWR. In both case, the Crazyflies gets position update from the system and use it to calculated an estimated position. The control scripts send a position setpoint which is the same independent of what system or data is used to calculate the position estimate.

So yes, you should be able to use the autonomousSequence.py script.

What about the loco deck LEDs. If the Crazyflies are currently ranging in TDoA mode the 3 LEDs RX, SFD and RXOK should blink. TX should NOT blink. Are you observing this behavior?

You could also connect the Crazyflies one by one with the client and look at the LPS tab to see if the Crazyflie has a reasonable position estimate.

mn14jg
Beginner
Posts: 14
Joined: Fri Jan 26, 2018 12:24 pm

Re: LPS configuration

Post by mn14jg » Wed Mar 07, 2018 10:49 am

I agree that the CF's do not have a position update from the system.

I managed to run autonomousSequence.py after restarting and reconfiguring (setting the coordinates) of the LPS in the Windows client. I do notice however the TX light flashing during flight, my understanding is that this means the deck is transmitting data? I have the log position enabled in the terminal - could this be the reason for this or shouldn't TX be flashing in any case?

An interesting note about the client displaying the location (this is before I reset the LPS system),
- When connected to CF via radio, CF position was increasing with time in all axes despite CF not actually moving anywhere
- When connected via USB, position seemed to be fairly accurate

The error seemed to disappear after resetting the LPS.

arnaud
Bitcraze
Posts: 1752
Joined: Tue Feb 06, 2007 12:36 pm

Re: LPS configuration

Post by arnaud » Thu Mar 08, 2018 9:59 am

What version of the firmware are you running?

With the latest version of the nRF51 firmware, the power has been reduced to reduce interference with the DWM UWB radio. Your tests with USB hints that you are using an older version of the nRF51 firmware. You can upgrade it by flashing the release zip with the client or by compiling it yourself.

mn14jg
Beginner
Posts: 14
Joined: Fri Jan 26, 2018 12:24 pm

Re: LPS configuration

Post by mn14jg » Fri Mar 16, 2018 12:23 pm

Hi, sorry for the delay in reply,

I am using the latest firmware,

I have tested 2 CF's extensively using swarmSequence.py and seem to have hit a good success rate (~75%) by:

- Resetting the power to the LPS prior to each test
- Restarting each CF prior to each test
- Resetting the radio prior to each test
- Orienting the CF's towards the X axis
- Hardcoding the coordinates for each sequence (before I was using x0-3, y0-3 etc)
- Using the LPS deck in combination with the Flow deck (with one CF this is impressively accurate with an rms ~1cm in each axis)

One last question, is it possible to print the location of each CF whilst swarming? I have done this with a single CF using autonomousSequence.py, It would be fantastic to find the rms for two of them flying together. I have tried copying the lines of code that print the location but haven't managed to get it to work.

arnaud
Bitcraze
Posts: 1752
Joined: Tue Feb 06, 2007 12:36 pm

Re: LPS configuration

Post by arnaud » Wed Mar 21, 2018 9:58 am

Are the failure mostly at take-off? In recent version of the lib we added a soft take-off that has solved almost all the take-off crash for us.

You can setup a log block on each Crazyflie to get the positions in your script. There is a couple of example in the crazyflie-lib repos that shows how to setup a log block. You can connect the Crazyflie from the client and look at the log TOC tab to see the list of available log variables. The position is in the variables stateEstimate.x/y/z.

mn14jg
Beginner
Posts: 14
Joined: Fri Jan 26, 2018 12:24 pm

Re: LPS configuration

Post by mn14jg » Mon Apr 09, 2018 9:43 am

Hi Arnaud,

Sorry for the delay, I had/havce limited access to the lab. All copters are using the latest firmware and I have the latest version of the lib, the take-off is fairly smooth now. When flying four CF's, each with an LPS and flow deck installed, only one of them seems to be in it's set position. Furthermore, the same CF's LPS deck is the only one flashing, the other 3 do not flash at all as if they weren't communicating with the anchor system.

Post Reply