Giter VIP home page Giter VIP logo

arduino-dw1000-ng's Introduction



Arduino library to use Decawave's DW1000 IC and relative modules.

c++11 Arduino

Status

⚠️ We are archiving the repo as we can't support it anymore and we are not currently working with dw1000 hardware, feel free to create your own fork if you intend to support the project, we will be happy to add a link on this project. Thank you everyone for the support you gave this project it was truly appreciated.

Differences with thotro/arduino-dw1000

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.

Features

Ranging Localization NLOS Optimizations Frame filtering Antenna Calibration Antenna Delay Arduino EEPROM Transmission power setup Deep sleep Sleep Double buffering Transmit Power Spectrum Test Mode Continuous wave mode

Devices

Arduino ESP8266 ESP32 STM32-BluePill

Specific tested devices, whit related pinout, are inside the Wiki.

Installation

Requires c++11 support, Arduino IDE >= 1.6.6 support c++11.

  1. Get a ZIP file of the master branch or the latest release and save somewhere on your machine.
  2. Open your Arduino IDE and goto Sketch / Include Library / Add .ZIP Library...
  3. Select the downloaded ZIP file of the DW1000 library
  4. You should now see the library in the list and have access to the examples in the dedicated section of the IDE

Usage

Check examples folder for basic usage.

The Decawave documentation helps a lot in understanding this project, especially if you want to go deeper.

Authors

License

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

arduino-dw1000-ng's People

Contributors

aacton avatar alessandroportela avatar anacron-sec avatar az-z avatar bartslinger avatar bartvelp avatar cimbalo avatar cimbalomecoil avatar gautierhattenberger avatar jwzawadzki avatar leosayous21 avatar martonmiklos avatar mersious avatar mikes159 avatar njroussel avatar pascalbros avatar per1234 avatar rotzbua avatar sonic0 avatar steffenmauch avatar stevenh2812 avatar thotro avatar tommag avatar valeros avatar verbatimt avatar yuhki50 avatar zrecore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-dw1000-ng's Issues

Arduino, ESP32, fails to compile

Step 1: What do you want?

  • The library examples do not compile when ESP32 boards are selected.

Step 2: Describe your environment

  • Arduino IDE version or Toolchain: Arduino IDE 1.8.9, with ESP32 Arduino board package
  • dw1000ng Library version: Whatever version this is.
  • Arduino device: ESP32-PICO-D4, DWM1000

Step 3: Describe the problem

Affected file(s) or example(s):

  • BasicConnectivityTest example

Steps to reproduce (for bugs only):

  1. Open the BasicConnectivityTest example
  2. Select "ESP32 PICO Kit" as the board
  3. Attempt to compile

Observed Results:

  • What happened? This could be a description, log output, etc.
Users/aalbino/Documents/Arduino/libraries/arduino-dw1000-ng/src/DW1000NgRTLS.cpp: In function 'RangeRequestResult DW1000NgRTLS::tagRangeRequest()':
/Users/aalbino/Documents/Arduino/libraries/arduino-dw1000-ng/src/DW1000NgRTLS.cpp:175:51: error: narrowing conversion of 'DW1000NgUtils::bytesAsValue((& init_recv[13]), 2)' from 'uint64_t {aka long long unsigned int}' to 'uint16_t {aka short unsigned int}' inside { } [-Werror=narrowing]
         return { true, DW1000NgUtils::bytesAsValue(&init_recv[13], 2) };
                                                   ^
/Users/aalbino/Documents/Arduino/libraries/arduino-dw1000-ng/src/DW1000NgRTLS.cpp: In function 'RangeResult DW1000NgRTLS::tagFinishRange(uint16_t, uint16_t)':
/Users/aalbino/Documents/Arduino/libraries/arduino-dw1000-ng/src/DW1000NgRTLS.cpp:208:64: error: narrowing conversion of 'DW1000NgUtils::bytesAsValue((& act_recv[11]), 2)' from 'uint64_t {aka long long unsigned int}' to 'uint16_t {aka short unsigned int}' inside { } [-Werror=narrowing]
                 return {true, true, DW1000NgUtils::bytesAsValue(&act_recv[11], 2), 0};
                                                                ^
/Users/aalbino/Documents/Arduino/libraries/arduino-dw1000-ng/src/DW1000NgRTLS.cpp: In function 'RangeInfrastructureResult DW1000NgRTLS::tagRangeInfrastructure(uint16_t, uint16_t)':
/Users/aalbino/Documents/Arduino/libraries/arduino-dw1000-ng/src/DW1000NgRTLS.cpp:231:35: error: narrowing conversion of 'result.RangeResult::new_blink_rate' from 'uint32_t {aka unsigned int}' to 'uint16_t {aka short unsigned int}' inside { } [-Werror=narrowing]
             return { true, result.new_blink_rate };
                                   ^
/Users/aalbino/Documents/Arduino/libraries/arduino-dw1000-ng/src/DW1000NgRanging.cpp: In function 'double DW1000NgRanging::correctRange(double)':
/Users/aalbino/Documents/Arduino/libraries/arduino-dw1000-ng/src/DW1000NgRanging.cpp:81:5: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
/Users/aalbino/Documents/Arduino/libraries/arduino-dw1000-ng/src/DW1000NgRTLS.cpp:236:5: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
/Users/aalbino/Documents/Arduino/libraries/arduino-dw1000-ng/src/DW1000NgRTLS.cpp: In function 'RangeResult DW1000NgRTLS::tagFinishRange(uint16_t, uint16_t)':
/Users/aalbino/Documents/Arduino/libraries/arduino-dw1000-ng/src/DW1000NgRTLS.cpp:215:5: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
/Users/aalbino/Documents/Arduino/libraries/arduino-dw1000-ng/src/DW1000NgRTLS.cpp: In function 'RangeAcceptResult DW1000NgRTLS::anchorRangeAccept(NextActivity, uint16_t)':
/Users/aalbino/Documents/Arduino/libraries/arduino-dw1000-ng/src/DW1000NgRTLS.cpp:301:5: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
cc1plus: some warnings being treated as errors
cc1plus: some warnings being treated as errors

Expected Results:

  • It should have compiled, but due to strict compiler flags, these warnings are treated as errors.

Trilateration

Testing out the StandardRTLSAnchorMain and wondering how I measure the positions of each of my anchor to add to the Position position_self = {0, 0}; so it gets the correction positioning. Also if i attached 3 anchors to a robot and used a tag would trilateration work or would I need to look at alternative method?

Using the library with an esp8266

I am trying to use the basic connectivity example with an ESP8266 and get the following error whenever a DW1000 function is called:

Abort called

stack>>>

ctx: cont
sp: 3ffffd80 end: 3fffffc0 offset: 01b0
3fffff30: 3ffe87b0 3ffee358 3ffe84fc 00000004
3fffff40: 3ffe84ce 00000000 3ffee240 00000004
3fffff50: 3ffe84ce 3ffe84cd 00000005 40100452
3fffff60: feefeffe 0000000f 00000005 40201b1c
3fffff70: 3fffdad0 00000001 3ffee2a8 402021d0
3fffff80: 00002580 0000001c 00000000 3ffee300
3fffff90: 3fffdad0 00000000 3ffee2d0 4020103c
3fffffa0: feefeffe feefeffe feefeffe 402026e8
3fffffb0: feefeffe feefeffe 3ffe84fc 4010073d
<<<stack<<<
�⸮�!9⸮^⸮⸮ISR not in IRAM!

Create API to set user-defined SFD

This is an advanced feature of the DW1000 that lets you specify a user-defined SFD sequence.
For reference check register file 0x21 - Channel inside DW1000 User manual.

Sending and Receiving From Multiple Channels

Hi,

I am trying to achieve TDOA approach and biggest problem here is to sync clocks. I am trying wireless clock sync.

The main idea here is to use 4 anchors, 1 is going to be the main anchor and send timestamp sync packages to other 3 slave anchors.

And TAGs are going to send blink messages to those 3 anchors and anchors will caculate TDOA's.

And I want to seperate sync and tag blink requests by sending and receiving them from different channels to use bandwidth more effieciently.

With these scenario I have some questions.

1 - Is it possible to achieve this ? Because 3 Slave Anchors needs to listen 2 channels at the same time? (Both tag blinks and Main Anchor sync packages)

2 - Is it possible to achieve wireless sync with such method? Because 1 nanosecond error in calculations means 30cm error localization.

There are companies achieved wireless sync with such method but it is not clear how they achieved this. May be they purchased IP from Decawave about Wireless Sync implementation.

I just want to here from you, and your ideas.

Thank you...

Regards

Inconsistent ranging

Hi,
So I am trying to get the range between an Anchor and a Tag. I do get a decent range however the ranges change a lot over time. The anchor and tag are at fixed positions however the range between the two keep dropping lower and lower or increasing higher and higherI have plotted the ranges below.

I am looking for any help as to why this is happening. I am using two AA batteries to power the DWM Modules and the grounds and powers are all connected. I have scoped power lines I get a 5% noise tolerance and the power is stable throughout.

I use Single Sided Two Way Ranging as I get better values than the Asymmetric method. I am looking for any help as to why the values are inconsistent.

inconsistent

Sending a Rang to Tag

Hello.
I want to improve your library for my goal. I'm searching about a way to implement sending Rang to Tag side.
in this method A tag side can print its Rang from each anchor that it blinks with.
right now we don't have it.

We read dwm1000 manuall.If i understand correclty there are some optional ways to do that.
I understood the tag and anchor connect in this way :

Tag : blink
Anchor : Ranging_INIT
Tag : Poll
Anchor: Poll-Ack
Tag: Sending Final Message to anchor
Anchor: have Rang

at this time Anchor calculates and have a Correct Rang then print it but Tag does not have. it does not print anything right now.

in the best solution We should send a Rang String to Tag after "Final Message" from anchor.

I found some lib codes in each side, tag and anchor.step by step what happend.
I could send a packet frame with "0x60" value from anchor side,
but I could not find a way to wait to recieve this packet frame "0x60" in Tag side.

I don't know what "command - code - function" i should use to wait in Tag side to receive "0x60" packet frame in correct time.

I mean the waiting time for receiving packet in Tag side.(halt time)

Add FemtoBeacon ESP32 (ESP32-D2WD) DecaWave Pinout

Step 1: What do you want?

  • Present a new hardware adapter board or wiring.

Step 2: Describe your environment

  • Arduino IDE version or Toolchain: _____
  • dw1000ng Library version: _____
  • Arduino device: _____
  • Used adapter board: FemtoBeacon ESP32 LPS (ESP32-D2WD, DWM1000 + IMU)

Step 3: Describe the problem

Affected file(s) or example(s):

  • README.md

DeepSleep doesn't work

DeepSleep is bugged. After Weak up, ranging doesn't work.
All configurations are restored from AON (except txAntennaDelay and EUI).

Ranging doesn't work using useStandardSFD() and 850Kpbs mode

The device doesn't seem to range, a possible problem seems the 0x08 as sfd length but the manual states it should work.

NOTE: Correction of N inside receive power functions use value inside sfd length register 0x21, so a change in this should be strictly controlled.

Wrong distance read with three anchor working together

Hello~
I am doing a university project, and using thoros' code. Thoro's project is not active and stop to develop, so I always find nowhere to communicate and solve problems, it confused me for a long time until I found you.(maybe because i'm not familiar with github)

As for my part of DW1000 research. I simple use thotro's code, and do a little modification to meet my own demand. I read and understand most source code in his project like DW1000.cpp, DW1000Ranging.cpp etc. At first, the ranging always have a drift in distance, after I change the antenna delay, the drift disappear.

However, my goal is to use three anchors to locate the tags. So I open the three anchors at same time. But there are only one anchor reads the right data, while the other two anchors read very wrong data. and it's strange that, when I only turn off the well-working anchor, one of the rest anchor will reads the right distance. Same things happen when I turn off the second well-working anchor, and the only left anchor will reads the right distance. This is first of my problem.

Then I use some debug code trying to find out why this strange things happen, I print out the time stamp to get the Treply and Tround. However, I found that Treply is bigger than Tround sometime(not seldom but frequently appear in a bulk of continues ranging data). We know in the ranging algorithm, Tround = Treply +2 * Tof (time of flight). However, those ridiculous can calculate out the right distance (after antenna delay). This is my second problem.

And I have briefly read your example TwoWayRangingInitiator/Responder, and I think maybe you haven't start to develop the multiple anchors and multiple tags system. And I test your code in my device and found your ranging accuracy is very high, plus no timestamp error as I found in thoro's project. If you want to develop the multiple system, I'd like to help.

Here are my calibration system and my device: 4 * DWM1000; 4 * Arduino UNO R3

tim 20181012012623
tim 20181012012646

And this is data when I test your example TwoWayRangingInitiator/Responder, the ripple is around ±3 cm, which is every good, very few point got extreme big distance having 15cm error can be removed by filter.
tim 20181012013225
tim 20181012013304

Looking forward to your reply.
Best wishes,
Elon

setDefaults inside examples are not used

Even inside DW1000Ranging abstraction i see this setDefaults() used after newTransmit() and newReceive() function calls.
setDefaults() checks if the devicemode is IDLE otherwise it does nothing, but in the cases I mentioned the device is never in idle.

About Multiple Tag Support

Hi, I am trying to work with multiple tags. I mean at least 1 anchor and 2 tags at the same time
(thotro's library don't have this support yet, If you put second tag in to the test environment everything goes bad)

I couldn't find any info about multiple tag support in your wiki.

Is your library has multiple tag support?

Thanks

Example TwoWayRanging is not work.

Step 1: What do you want?

  • TwoWayRangingInitiator and TwoWayRangingResponder do not work. therefore I want them to work.

Step 2: Describe your environment

  • Arduino IDE version or Toolchain: Arduino IDE 1.8.7
  • Arduino device: Arduino Uno R3
  • Used adapter board: None

Step 3: Describe the problem

Affected file(s) or example(s):

  • TwoWayRangingResponder.ino
  • TwoWayRangingInitiator.ino

Observed Results:

twowayranging-failed
It seems not to work!

Thus I tried Basic Connectivity Test.
basicconnectivitytest
I'm not sure it's correct output because I'm a beginner of Arduino and DWM1000.
But I don't think there is any noticeable problem.

And then I uploaded Basic Sender/Receiver to Arduino.
basic-sender-receiver

I still have no clue about this, but it seems to work fine.

EDIT: thotro/arduino-dw1000
I tried also thotro's library.
thotro
The device is removed immediately after it is added.

Why are BasicSender and Receiver working but TwoWayRanging not working?

Expected Results:

  • Jaja, I expected they work.

Wiring

wire
real

Datarate at 110 Kbps with 4096 preamble length doesn't work.

//static constexpr byte MODE_LONGRANGE_LOWPRF_LONGPREAMBLE[] = {TRX_RATE_110KBPS, TX_PULSE_FREQ_16MHZ, TX_PREAMBLE_LEN_4096};
//static constexpr byte MODE_LONGRANGE_HIGHPRF_LONGPREAMBLE[] = {TRX_RATE_110KBPS, TX_PULSE_FREQ_64MHZ, TX_PREAMBLE_LEN_4096};

They should be settable but a bug makes the device not work, so they are commented while working at this problem.

The main anchor can't receive message from anchor C.

To begin with, I use the Arduino UNO R3. and use 5V to supply the DW1000 chips.

The situation is that, main anchor can range with the tag, and so does the anchor B, so main anchor can receive the ranging report from anchor B.

However, main anchor can't receive message from anchor C, even I tried to use different DW1000 chips to have the test, the main anchor still can't find anchor C. So, this might not be a hardware problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.