User Tools

Site Tools


doc:lps:toda3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
doc:lps:toda3 [2018-06-13 13:54]
kristoffer
doc:lps:toda3 [2018-06-15 08:08]
kristoffer
Line 5: Line 5:
 The TDoA3 mode is experimental. The protocol and implementation might change but is fairly stable. The TDoA3 mode is experimental. The protocol and implementation might change but is fairly stable.
 </WRAP> </WRAP>
 +
 +===== Compile and flash =====
  
 To try it out you will have to do the following: To try it out you will have to do the following:
  
-===== The Crazyflie =====+==== The Crazyflie ====
  
   * Get the latest source code for the firmware from [[https://github.com/bitcraze/crazyflie-firmware]]. Make sure the git submodules are updated   * Get the latest source code for the firmware from [[https://github.com/bitcraze/crazyflie-firmware]]. Make sure the git submodules are updated
Line 14: Line 16:
   * Flash the Crazyflie with ''make cload'' script.   * Flash the Crazyflie with ''make cload'' script.
  
-===== The LPS Nodes =====+==== The LPS Nodes ====
  
   * Get the latests source code for the firmware from [[https://github.com/bitcraze/lps-node-firmware]]. Make sure the git submodules are updated   * Get the latests source code for the firmware from [[https://github.com/bitcraze/lps-node-firmware]]. Make sure the git submodules are updated
Line 31: Line 33:
 ===== Longer range ===== ===== Longer range =====
  
-In this mode the UWB bitrate is lower and the messages will reach longer.+In this mode the UWB bitrate is lower and the data of messages can be read at a longer distance. The packet rate will be reduced though.
  
 Recompile both Crazyflie and anchors with the LPS_LONGER_RANGE compile flag. Recompile both Crazyflie and anchors with the LPS_LONGER_RANGE compile flag.
Line 37: Line 39:
 Example: ''make "EXTRA_CFLAGS=-DLPS_TDOA_USE_V3 -DLPS_TDOA_ENABLE -DLPS_LONGER_RANGE"'' Example: ''make "EXTRA_CFLAGS=-DLPS_TDOA_USE_V3 -DLPS_TDOA_ENABLE -DLPS_LONGER_RANGE"''
  
 +===== Longer preamble =====
 +
 +It is possible to use a longer preamble, this will also reduce packet rate. There is no compile flag for this setting, it requires some code modifications in the Crazyflie and the anchors.
 +
 +==== The Crazyflie ====
 +
 +  * Find the src/deck/drivers/src/locodeck.c file
 +  * Locate the call to dwEnableMode()
 +  * Change the second argument to MODE_LONGDATA_MID_ACCURACY
 +  * Compile and flash
 +
 +==== The LPS Nodes ====
 +
 +  * Find the src/uwb.c file
 +  * Locate the call to dwEnableMode()
 +  * Change the second argument to MODE_LONGDATA_MID_ACCURACY
 +  * Find the src/uwb_tdoa_anchor3.c file
 +  * Locate the line where PREAMBLE_LENGTH_S is defined
 +  * Change it to 1024 bits: #define PREAMBLE_LENGTH_S ( 1024 * 1017.63e-9 )
 +  * Compile and flash
 +
 +===== Sniffing =====
 +
 +If an anchor is configured to act as a sniffer, it can be used to listen to the UWB messages in the system. To set an anchor to sniffer mode, connect via USB.
 +
 +==== Basic sniffing ====
 +
 +Connect the sniffer via USB and check in /dev which port that it uses. Use this as the first argument
 +The second argument is the output format, use yaml
 +example: ''python3 tools/sniffer/sniffer_binary.py /dev/tty.usbmodem1421 yaml''
 +
 +==== TDoA 3 parsing ====
 +
 +Pipe the yaml into the TDoA 3 decoder to see TDoA 3 data unpacked
 +
 +example: ''python3 tools/sniffer/sniffer_binary.py /dev/tty.usbmodem1421 yaml | python3 tools/sniffer/tdoa3_decoder.py''
 +
 +This will show all data that the sniffer receives. To limit the output it is possible to filter which anchors to show. Add one or more ids at the end to only show data from only these anchors.
 +
 +example: ''python3 tools/sniffer/sniffer_binary.py /dev/tty.usbmodem1421 yaml | python3 tools/sniffer/tdoa3_decoder.py 2 3''
 +
 +==== Time of flight ====
 +
 +By piping the TDoA 3 data into the TOF tool, the measured anchor to anchor distances will be displayed. By adding the 'm' argument the output will be in meters instead of UWB clock ticks.
  
 +example: ''python3 tools/sniffer/sniffer_binary.py /dev/tty.usbmodem1421 yaml | python3 tools/sniffer/tdoa3_decoder.py | python3 tools/sniffer/tdoa3_tof.py m''
doc/lps/toda3.txt · Last modified: 2020-05-12 14:08 by kimberly