F-Army / arduino-dw1000-ng

Arduino driver and library to use Decawave's DW1000 IC and relative modules.
MIT License
121 stars 64 forks source link

Calculate Position on Tag side #190

Open CarlosAguilar1986 opened 3 years ago

CarlosAguilar1986 commented 3 years ago

Step 1: What do you want?

Step 2: Describe your environment

Step 3: Describe the problem

Affected file(s) or example(s):

Steps to reproduce (for bugs only):

  1. For the moment I have switched several functions (example: DW1000NgRTLS:transmitRangingInitiation is done in the tag side and DW1000NgRTLS::tagTwrLocalize is done in the anchor's side)

Observed Results:

Expected Results:

Relevant Code:

  // TODO(you): code here to reproduce the problem
Sonic0 commented 3 years ago

Hi @CarlosAguilar1986, yes it's possible. You have to modify the DW1000NgRTLS files (this implementation is just an example of extraction) to not return the range result to the anchors or make your own workflow taking it as an example. DW1000NgRTLS files are a simple implementation of the RTLS standard ISO/IEC 24730-62, take a look at it. There are probably other closed issues with similar questions.

CarlosAguilar1986 commented 3 years ago

Ok, thanks I will try that :)

Sonic0 commented 3 years ago

I don't remember well about the flow. You should transform anchor main's code like anchor B/C and all Anchors are supposed to send the range to the Tag. The Tag should be like Anchor main. It's harder than I say to you.

CarlosAguilar1986 commented 3 years ago

Ok thanks, yes for the moment I am doing something quite similar. In my case The three anchors send Blinks (instead of having one BLINKI have BLINK_1, BLINK_2 and BLINK_3) and the Tag does the transmitRangingInitiation with each anchor but I have weird results sometimes (maybe some interferences I guess ?).

Then I read in the official decawave documentation (APS013 APPLICATION NOTE, The implementation of two-way ranging with the DW1000, Page 5 at the bottom) : "In the case where it is necessary for the tag to be aware of the range, the anchor may optionally send an immediate message to the tag with the calculated TOF" So I was wondering if your library had this option implemented already since I wanted some better/cleaner solution than what I had.

Sonic0 commented 3 years ago

In our case, the "optional message" would be Range-confirm(Anchor A and B) or activity-finished(Anchor C). In your case, you could modify one of the last steps of the flow (transmitRangingConfirm or transmitActivityFinished) and send back the range in one of two optional final params. This is an example of a final step payload of an optional message in the RTLS standard: ranging_confirm

Obviously, if you don't want to respect the standard you could refactor the entire DWM1000RTLS class personalizing the payloads. Decawave in their examples does not respect perfectly the standard.

CarlosAguilar1986 commented 3 years ago

Yes, I see now, thanks again for your time :)