Arduino library to use Decawave's DW1000 IC and relative modules.
This is a fork of https://github.com/F-Army/arduino-dw1000-ng.
The main reason for this fork is to implement a tag centered positioning system.
A "Main" Anchor indicates each tag sequentially to initiate ranging with each Anchor.
In the original version, there are 4 messages exchanged when using tagTwrLocalize :
-
- 1 : Short blink from the Tag (transmitTwrShortBlink)
-
- 2 : RANGING_INITIATION from the main Anchor (transmitRangingInitiation)
-
- Poll from Tag (transmitPoll)
-
- ACTIVITY_CONTROL from anchor (transmitResponseToPoll)
-
- FINAL_MESSAGE from Tag (transmitFinalMessage)
-
- ranging confirm from Anchor (transmitRangingConfirm), where the anchor sends the id of the next tag, encoded in 2 bytes
We then repeat steps 1-4 untill the last Anchor, where we send a transmitActivityFinished (instead of transmitRangingConfirm).
To gather the ranging data, each Anchor then needs to transmit its range to the Tag sequentially. What we want is to exploit the 4th message to send the range instead of the id of next tag (or blink_rate for the last anchor).
For that, we need an architecture change, where the tag itself is aware of all anchor ids.
On a more global aspect, as we need to get the position of multiple tags, we decided to initiate all communications from the Main Anchor. In the process, this message replaces the RANGING_INITIATION from Main, reducing by one the amount of messages from the original architecture.
A problem we encountered later was the range calculation time taken by the atmega 32u4 (2200 to 2500 µs). This forces us to add a delay in the loop. As the calculation time is much more reasonable on the ESP32 (around 170 µs), we replace the tag by the ESP32, and force all expensive calculations there. This forces us to change the type of the fourth message to send the 2 timing values.
-
- 1 : data from Main (transmitTwrShortBlink)
-
- 2 : Short blink from the tag (transmitRangingInitiation)
-
- Poll from the Anchor (transmitPoll)
-
- ACTIVITY_CONTROL from the Tag (transmitResponseToPoll)
-
- FINAL_MESSAGE from the Anchor (transmitFinalMessage)
-
- ranging confirm from the Tag (transmitRangingConfirm)
This is a fork of https://github.com/thotro/arduino-dw1000.
The main reason for this fork is because the development there is really slow (due to the original author not developing it anymore) and some important features were missing (for example antenna delay calibration).
We also wanted to change how the ranging logic works.
Rather than providing a ranging loop, we wanted to provide functions to send the different Two way ranging flow frames, giving the user more control over the program.
The base driver was also re-written in a lot of places, to make every API function more independent from each other.
We also plan to make very high-level abstractions to hack projects fast.
Specific tested devices, whit related pinout, are inside the Wiki.
Requires c++11 support, Arduino IDE >= 1.6.6 support c++11.
- Get a ZIP file of the master branch or the latest release and save somewhere on your machine.
- Open your Arduino IDE and goto Sketch / Include Library / Add .ZIP Library...
- Select the downloaded ZIP file of the DW1000 library
- You should now see the library in the list and have access to the examples in the dedicated section of the IDE
Check examples folder for basic usage.
The Decawave documentation helps a lot in understanding this project, especially if you want to go deeper.
- Michele 'an4cr0n' Biondi : https://github.com/an4cr0n
- Andrea 'Sonic0' Salvatori: https://github.com/Sonic0
The project is under MIT (see LICENSE.md)
Some files are under a Dual Apache 2.0/MIT because this is a fork of thotro/arduino-dw1000
