Tdoa positioning is slow

All discussions related to the Loco Positioning system
Post Reply
EgeYlcn
Beginner
Posts: 12
Joined: Fri Jan 19, 2018 6:28 am

Tdoa positioning is slow

Post by EgeYlcn » Fri Jan 19, 2018 6:40 am

Hi ,
When I use the TdoA code in my tag , positioning is 10-15 seconds late. I'am using only the positioning part of the code is active. ( Extra part of codes for acceleration, motion and drone are inactive . )

Could it be related to Kalman Filter ?

Thank you

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

Re: Tdoa positioning is slow

Post by arnaud » Fri Jan 19, 2018 8:51 am

If you are using the Crazyflie kalman filter without feeding any accelerometer and gyroscope input, I could expect it to not behave very well since it is designed and tuned to use accelerometer/gyro.

If you only want position from the UWB you could use a gradient descent or particle filter algorithm instead of the ekf.

EgeYlcn
Beginner
Posts: 12
Joined: Fri Jan 19, 2018 6:28 am

Re: Tdoa positioning is slow

Post by EgeYlcn » Fri Jan 19, 2018 11:20 am

First of all, Thank you for your answer. What I'm doing is taking the raw data from the tag and applying the filter on the different platform. However, the positioning is still delayed. What could be the reason for this?

Thank you

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

Re: Tdoa positioning is slow

Post by arnaud » Mon Jan 22, 2018 12:33 pm

If you are applying the unmodified Kalman filer, I expect the problem comes from the fact you are not feeding accelerometer and gyroscope data as well.

Using an other kind of positioning filter is one way to produce quicker results, for example the lps-ros package contains an implementation of a particle filter and an LMS filter, both are able to output a position from positioning measurements.

EgeYlcn
Beginner
Posts: 12
Joined: Fri Jan 19, 2018 6:28 am

Re: Tdoa positioning is slow

Post by EgeYlcn » Wed Mar 28, 2018 9:04 am

Hi Arnaud,

First of all, Thanks for your answer.

I added MPU-9255 Sensor in to My Tag. I want to send data to Kalman Filter in the code. Which format should I send this data to the function ? Is it raw data or another format ?

Best Regards,

Ege

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

Re: Tdoa positioning is slow

Post by arnaud » Wed Mar 28, 2018 9:41 am

If you look in stabilizer.c, the estimator is fed with the sensorData_t structure: https://github.com/bitcraze/crazyflie-f ... #L121-L132. If you fill this structure with your sensor data, the kalman filter will use it. If you kept the firmware fairly unmodified, you can create a new sensor file and just remove part of the stabilizer loop that are unrelated to your work.

Our of curiosity, could you share a bit more what you are working on :)?

EgeYlcn
Beginner
Posts: 12
Joined: Fri Jan 19, 2018 6:28 am

Re: Tdoa positioning is slow

Post by EgeYlcn » Wed Mar 28, 2018 11:34 am

Hi Arnaud,

I'm using STM32L433 for my Tag and STM32F103 for my Anchors. By the way, I made some changes in the code to fit for those MCUs. I'm a Software Engineering student I'm working on the Indoor Positioning Systems in my thesis. I wasnt using the MPU sensor but now i have added mpu9255. I just take raw IMU data.
For tracking system, i use tdoa and tried both ways for calculation. First i used estimator (without IMU) but it was slow. Than i sent tdoadistdiff values to Matlab (estimator is off, just sending data) and i made a algorithm to calculate position. But it is slow too. When i move the tag, it is not affecting directly to the position. Generally there is near 20sec delay for a position change.Data packet consist of PreviousAnchor, Anchor and TdoaDistDiff.

However , this communication has some wrong as I said in another title dimension   ( viewtopic.php?f=16&t=2900 ).

I have seen that there is a newer version of Tdoa called TDOA2 at https://www.bitcraze.io/category/loco-positioning/
and it says "So now for the part where TDoA2 helps: previously we had to have the 3 packets in sequence in order to calculate a TDoA, if any one of these where missing the measurement would fail or worse, it could give the wrong result. Since we did not have sequence numbers, it was hard to detect packet loss. Now that we have sequence numbers, we can understand when a packet is missing and discard the faulty data. We also do not have to calculate the distance between anchors in the tag anymore, it is calculated by the anchors themselves. This means that we can calculate a TDoA with only two consecutive packets which increases the probability of a successful calculation substantially."

Maybe my problem is losing the sequence order because i use old TDOA code.
What do you suggest me to do for solving the time delay problem?

Best Regards,

Ege

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

Re: Tdoa positioning is slow

Post by arnaud » Wed Apr 04, 2018 9:41 am

20 seconds delay sounds like something else, not only the IMU. Are you sure your data makes it to the extimator quickly and that you do not have much delay in your logging?

The TDoA2 algoritms (what is now in the master branch) is much better at detecting communication problem so I would suggest swritching to it, it would allow to better debug if there is any problem on the UWB side of things.

Post Reply