Using multiple CFs, unable to get accurate positioning data

All discussions related to the Loco Positioning system
Post Reply
jfenton888
Beginner
Posts: 3
Joined: Tue Nov 14, 2017 3:16 am

Using multiple CFs, unable to get accurate positioning data

Post by jfenton888 » Sat May 05, 2018 4:29 pm

I am a high school student doing a project on drones, specifically drone swarming. I am running all crazyflie dependencies locally on mac, for both editing the firmware and the python client. I have a loco positioning system and am able to fly autonomous sequences with a single drone, but I am having trouble in adding more drones at once. I have been using 2 seperate drones, one mapped to 'radio://0/100/2M/E7E7E7E7E9' and the other is at 'radio://0/80/2M/E7E7E7E7E5'; both work in manual flight and scripted flights when on their own but when I put the second drone inside the system, the first becomes unable to find an accurate position. This means that even when I try to run single drone autonomous sequences, the first drone is unable to initialize its position, and when I run the cfclient and look at the positioning data I can see the drift of the drone on the "Loco Positioning" tab.

A normal readout from a short scripted flight looks like this:
Connected to radio://0/100/2M/E7E7E7E7E9
Waiting for estimator to find position...
Setting position (2, 2, 1.5, 0)
pos: (2.0132405757904053, 1.8401093482971191, 1.3648521900177002)
pos: (2.032116174697876, 1.853730320930481, 1.363878846168518)
pos: (2.0352940559387207, 1.8450803756713867, 1.3649288415908813)
pos: (2.013648748397827, 1.9259790182113647, 1.3624447584152222)
pos: (1.9842227697372437, 1.987541675567627, 1.3831425905227661)
pos: (1.9735009670257568, 2.0545108318328857, 1.4239975214004517)
pos: (1.9258980751037598, 2.095522880554199, 1.4476276636123657)
pos: (1.9060910940170288, 2.091430187225342, 1.4711302518844604)
pos: (1.8712376356124878, 2.0966243743896484, 1.4727686643600464)
pos: (1.882103443145752, 2.0961616039276123, 1.4711133241653442)
pos: (1.895514965057373, 2.0769124031066895, 1.480021357536316)
pos: (1.9169895648956299, 2.0186049938201904, 1.483495831489563)
pos: (1.953879952430725, 1.979788899421692, 1.4974453449249268)
pos: (1.9812110662460327, 1.9873608350753784, 1.492977261543274)
Setting position (2, 2, 2.2, 0)
pos: (2.024451732635498, 1.968841791152954, 1.4754644632339478)
pos: (2.0349740982055664, 1.9497103691101074, 1.48885977268219)
pos: (2.034773111343384, 1.9257667064666748, 1.5220482349395752)
pos: (2.053302526473999, 1.9335815906524658, 1.5823057889938354)
pos: (2.052931308746338, 1.9361259937286377, 1.6537338495254517)
pos: (2.025348424911499, 1.9586601257324219, 1.760002613067627)
pos: (1.988242506980896, 1.9618996381759644, 1.8552173376083374)
pos: (1.9664711952209473, 2.0248875617980957, 1.9475793838500977)
pos: (1.9838694334030151, 2.043412923812866, 1.9983487129211426)
pos: (1.9965635538101196, 2.067814588546753, 2.0593817234039307)
pos: (2.0032405853271484, 2.064793825149536, 2.1142895221710205)
pos: (1.9898574352264404, 2.0232021808624268, 2.1482646465301514)
pos: (1.9825655221939087, 2.010118007659912, 2.1912524700164795)
pos: (1.9644389152526855, 2.016866445541382, 2.2274880409240723)
pos: (1.9466363191604614, 2.023890256881714, 2.251852512359619)
pos: (1.9394391775131226, 2.0106403827667236, 2.2682571411132812)
Setting position (2, 2, 1.5, 0)
pos: (1.9391124248504639, 2.022911310195923, 2.2726857662200928)
pos: (1.9249145984649658, 2.036590099334717, 2.2407569885253906)
pos: (1.9164429903030396, 2.0428080558776855, 2.17634916305542)
pos: (1.9315756559371948, 2.035041093826294, 2.0653178691864014)
pos: (1.906537413597107, 2.002906084060669, 1.9673551321029663)
pos: (1.8791911602020264, 1.9868481159210205, 1.8415427207946777)
pos: (1.8625050783157349, 1.9713937044143677, 1.7201671600341797)
pos: (1.8377490043640137, 1.9588370323181152, 1.6404863595962524)
pos: (1.8366109132766724, 1.9570597410202026, 1.5855236053466797)
pos: (1.8185492753982544, 2.0067169666290283, 1.5565698146820068)
pos: (1.8220938444137573, 2.0284247398376465, 1.5427448749542236)
pos: (1.845190167427063, 2.036520004272461, 1.5343685150146484)
pos: (1.861393690109253, 2.035759687423706, 1.5207933187484741)
pos: (1.880123257637024, 2.0213186740875244, 1.497172236442566)
pos: (1.889443278312683, 2.04567289352417, 1.476442575454712)
pos: (1.9254190921783447, 2.0246541500091553, 1.4599710702896118)

When running the same script with the second crazyflie on, the system gets stuck at finding position:

Connected to radio://0/100/2M/E7E7E7E7E9
Waiting for estimator to find position...

and stays here for multiple minutes, but the most recent time I ran it I got this readout after waiting for 5 minutes
Setting position (2, 2, 1.5, 0)
pos: (10.0, 10.0, 0.0)
pos: (-9.99997615814209, -8.408860206604004, 0.0)
pos: (-9.999858856201172, -8.404145240783691, 0.0)
pos: (-9.99974536895752, -8.399431228637695, 0.0)
pos: (5.115708351135254, 8.99462890625, 0.12940330803394318)
pos: (5.075924396514893, 9.165750503540039, 0.0)
pos: (5.07603120803833, 9.170467376708984, 0.0)
pos: (5.076135158538818, 9.17518138885498, 0.0)
pos: (5.076238632202148, 9.17989730834961, 0.0)
pos: (5.106716632843018, 4.2287068367004395, 9.844881057739258)
pos: (5.195210933685303, 3.613251209259033, 10.0)
pos: (5.285830497741699, 3.0919384956359863, 9.996658325195312)
pos: (5.378366947174072, 2.664868116378784, 9.905911445617676)
pos: (-4.132901191711426, -1.821719765663147, 5.989927291870117)
pos: (1.2979507446289062, -9.98743724822998, 0.0)
Setting position (2, 2, 2.2, 0)
pos: (7.168886184692383, 9.998161315917969, 0.0)
pos: (10.0, 9.629834175109863, 10.0)
pos: (10.0, 9.083972930908203, 10.0)
pos: (10.0, 8.516751289367676, 10.0)
pos: (10.0, 7.926768779754639, 10.0)
pos: (10.0, 7.312650680541992, 10.0)
pos: (10.0, 6.672976016998291, 10.0)
pos: (-10.0, 5.976022243499756, 0.0)
pos: (-9.998984336853027, 5.980745315551758, 0.0)
pos: (-9.997962951660156, 5.985470294952393, 0.0)
pos: (-1.308367133140564, 9.83439826965332, 10.0)
pos: (-0.7981568574905396, 9.055551528930664, 10.0)
pos: (-0.34134528040885925, 8.358205795288086, 9.957975387573242)
pos: (-9.49024486541748, -10.0, 0.1875196099281311)
pos: (-9.349861145019531, -9.99685001373291, 0.0)
Setting position (2, 2, 1.5, 0)
pos: (-9.352754592895508, -9.992919921875, 0.0)
pos: (-9.355660438537598, -9.989006996154785, 0.0)
pos: (-4.828155517578125, 1.1933785676956177, 10.0)
pos: (10.0, 10.0, 0.0)
pos: (-9.998414039611816, -9.998866081237793, 0.0)
pos: (10.0, 5.51392126083374, 0.0)
pos: (10.0, 5.5186333656311035, 0.0)
pos: (10.0, 5.5233473777771, 0.0)
pos: (10.0, 5.528056621551514, 0.0)
pos: (10.0, 5.5327677726745605, 0.0)
pos: (10.0, 5.537479877471924, 0.0)
pos: (10.0, 5.5421929359436035, 0.0)
pos: (10.0, 5.546900272369385, 0.0)
pos: (10.0, 5.551612854003906, 0.0)
pos: (10.0, 5.556323051452637, 0.0)
pos: (4.705703258514404, -9.999537467956543, 0.0)


When running the CFClient, I get accurate position data unless the second crazyflie is turned on. Then, the position drifts well outside the expected cube

Screen Shot 2018-05-05 at 12.26.03 PM.png
drifting everywhere between -10 and 10 in x, y, and z

Please help I am already behind and on a short timeline.

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

Re: Using multiple CFs, unable to get accurate positioning data

Post by arnaud » Sat May 05, 2018 4:47 pm

It sounds like you are running the system in two way ranging mode and not in TDoA mode. Two way ranging does not work if more than one drone is switched ON, TDoA works for as many crazyflies as you want.
You can find more info about the positioning mode there: https://www.bitcraze.io/loco-pos-system ... ning-modes
And the documentation to switch mode is the lps getting started: https://www.bitcraze.io/getting-started ... m/#intro26

jfenton888
Beginner
Posts: 3
Joined: Tue Nov 14, 2017 3:16 am

Re: Using multiple CFs, unable to get accurate positioning data

Post by jfenton888 » Tue May 08, 2018 12:02 am

Thank you for the information. I had thought, based on some previously asked questions, that flying two crazyflies would still work in TWR. I have now ordered two more nodes to use for TDoA but in the meantime would it be possible to control multiple crazyflies using multiple radios? Is the problem that they hog communication with the radio or with the positioning nodes themselves? And either way would using multiple radios improve performance once in TDoA mode?

tobias
Bitcraze
Posts: 1818
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Using multiple CFs, unable to get accurate positioning data

Post by tobias » Tue May 08, 2018 1:44 pm

Yes flying two crazyflies in TWR is possible using the TDMA feature that divides the air time. Position update rate will go down but is still fully usable.

Currently one radio can handle around 8 crazyflies, if just sending setpoints, but it all depends on what amount of data is needed.

Post Reply