jbentham / uwb

Ultra-Wideband ranging tests
Apache License 2.0
6 stars 7 forks source link

Running UWB code on raspberry pi rather than on PC #1

Closed MatthiesBrouwer closed 3 years ago

MatthiesBrouwer commented 3 years ago

Hi Jeremy,

I'm an intern at a small dutch company researching indoor UAV navigation technologies, and I am using your code to measure UWB distances for localisation steps. First and foremost, wow! I'm impressed with this code's complexity, and I don't think I could have developed this myself over the timespan of my internship.

I do have a problem with which I was hoping you might be able to help me. The prototype I'm developing has a Raspberry PI positioned on the UAV with which distance measurements are performed (The master controller has to be on the UAV due to assignment requirements). Therefore, I wondered if you had some insight into what code alterations I could perform to the "dwm1000_range.py" code to get it to run on a PI with an attached dwm1000, rather than on an external controller that connects to the RPI?

With kind regards,

Matthies Brouwer

jbentham commented 3 years ago

Matthies Brouwer,

I don't have time to review the code, but generally I try to keep the Python code as simple as possible, so it will probably run unchanged on the Pi.

Perhaps you are wondering about the UDP network interface, which will be redundant if the code is running on the same device as the I/O interface. Personally, I wouldn't change that, and just use localhost (127.0.0.1) instead of a remote address. I doubt whether that'll slow down the system at all, and UDP does provide some useful buffering, which helps to maintain the data flow - also I do like to have the ability to test any new code on a PC, rather than always on the Pi.

I suspect the main issue you may find is calibrating the system; to obtain the distance value, you take the overall round-trip time (which is a surprisingly big number) and subtract the fixed time-delays in the system (another big number) and hope the result (a really small number) bears some resemblance to the actual distance. I did somewhat skate over this issue in the blog, so just bear in mind that it may take some effort to get the answer you want.

Jeremy Bentham

On 28/01/2021 09:52, MatthiesBrouwer wrote:

Hi Jeremy,

I'm an intern at a small dutch company researching indoor UAV navigation technologies, and I am using your code to measure UWB distances for localisation steps. First and foremost, wow! I'm impressed with this code's complexity, and I don't think I could have developed this myself over the timespan of my internship.

I do have a problem with which I was hoping you might be able to help me. The prototype I'm developing has a Raspberry PI positioned on the UAV with which distance measurements are performed (The master controller has to be on the UAV due to assignment requirements). Therefore, I wondered if you had some insight into what code alterations I could perform to the "dwm1000_range.py" code to get it to run on a PI with an attached dwm1000, rather than on an external controller that connects to the RPI?

With kind regards,

Matthies Brouwer

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jbentham/uwb/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNUSET4XM3CRTCOWQHCAZ3S4EXWRANCNFSM4WWYATRA.

MatthiesBrouwer commented 3 years ago

Hi Jeremy,

Using localhost works great, I've been testing since yesterday and it works perfectly. Furthermore, the calibration was a success. I ended up measuring 100 measurements at three distances (0 meters, 1 meter, 2 meters), and documented the average of measured distances and measured timestamps. The multiplier was mostly guessed but also works great at any distances. Thanks for the help!