jremington / UWB-Indoor-Localization_Arduino

Open source Indoor localization using Arduino and ESP32_UWB tags + anchors
GNU General Public License v3.0
130 stars 33 forks source link

Issue using more than 4 Anchors #14

Closed jhoydich closed 1 year ago

jhoydich commented 1 year ago

I tried the 3D localization problem utilizing 5 anchors to over constrain the LLS solution. Oddly enough the tag functioned properly when interfacing with 4 anchors, but once the 5th anchor was added, the tag basically halted the ranging protocol only returning ranges sporadically. I do not believe the issue is interfacing with 5 anchors. Currently I think the issue is with how _timerDelay variable is calculated for subsequent anchors. For a 5th anchor, the value is 171 ms which is close to the 200 ms value of _resetPeriod. I'll experiment some more and create a merge request if successful.

jremington commented 1 year ago

The ESP32_UWB_tag3D_4A code is currently configured for 4 anchors, maximum. It would not be difficult to change the array dimensions to accommodate more, although 7 tags total is the maximum allowed for the addressing scheme as it now stands.

See this comment at the head of the .ino file: // currently tag is module labeled #5 // This code calculates the (X,Y,Z) position in meters of a UWB tag, based on the known locations // of four UWB anchors, labeled 1 to 4 // S. James Remington 1/2022

I did not have 5 anchors to test, so did not get around to implementing the required changes. What I had in mind is that the code would automatically accommodate a variable number of active anchors (4, 5, 6) in the least squares algorithm, which is somewhat more complicated than requiring a fixed number of active anchors (currently four).

jhoydich commented 1 year ago

This issue was not using that example. My tag implementation is pretty much bare bones and my anchors are publishing ranges to a computer that handles the calculation.

I think the issue is in the underlying library.

jremington commented 1 year ago

I can't possibly comment on your example, not having seen the code. The least squares localization code I wrote simply requires a set of distances, and does not use the DW1000 library.

jhoydich commented 1 year ago

Sorry if I was not clear, the issue is not with localization. If a tag connects to over 4 anchors then the ranging loop basically becomes extremely sporadic, meaning the tag will send/reply to a ranging message every 10 to 20 seconds (if at all).

I intend to figure out the solution as I have the necessary hardware. I just wanted to post the issue here in case anyone else runs into the same issue. It seems like this was what #7 was experiencing as well.

jremington commented 1 year ago

Fair enough. Are you using the original Thomas Trojer DW1000 library, or the modified version I posted here?

The DW1000 library DOES have a limit on the number of devices that can be active, which I increased from 4 to 7. See defined constant MAX_DEVICES in DW1000Ranging.h

jhoydich commented 1 year ago

I've been using yours, but I'm sure this issue exists in his library as well. I just think there is some funky stuff going on with the various delay values in the DW1000Ranging file.

Yeah I did notice that constant. I'm curious if there was a reason he chose 4, but I doubt I would get a reply if asked.