User Tools

Site Tools


doc:lighthouse:setup

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
Previous revision
Last revision Both sides next revision
doc:lighthouse:setup [2019-04-03 15:42]
macke
doc:lighthouse:setup [2020-03-05 20:50]
kristoffer
Line 1: Line 1:
 +<WRAP center round important 60%>
 +This page is deprecated and is moved to the main Bitcraze website. Please go to:
 +
 + [[
 +https://www.bitcraze.io/docs/crazyflie-firmware/master/lighthouse_overview/
 +]]
 +
 +</WRAP>
 +
 ====== Setting up the lighthouse deck ====== ====== Setting up the lighthouse deck ======
  
Line 15: Line 24:
 It is possible to setup the SteamVR without a Head Mounted Display (HMD). This allows to setup a minimal system with just two Base stations and one controller or tracker. It can be quite useful when a full VR system is not needed or to setup a system at fairs or conference. It is possible to setup the SteamVR without a Head Mounted Display (HMD). This allows to setup a minimal system with just two Base stations and one controller or tracker. It can be quite useful when a full VR system is not needed or to setup a system at fairs or conference.
  
-Follow the guide from Triad: [[http://help.triadsemi.com/steamvr-tracking/steamvr-tracking-without-an-hmd|SteamVR Tracking without an HMD]] (the steps after 14 is optional). This has been tested to work on Windows and Linux.+Follow the guide from Triad: [[http://help.triadsemi.com/steamvr-tracking/steamvr-tracking-without-an-hmd|SteamVR Tracking without an HMD]] (the steps after 14 is optional). This has been tested to work on WindowsLinux and Mac. 
 + 
 +<WRAP center round info> 
 +**OSX** 
 + 
 +The osx implementation seems to be a bit shaky, but it is possible to make it work. I used the "macos_beta" flavour. 
 + 
 +The paths in the triad instructions are for Windows. On Mac OSX you will find the files to update in 
 + 
 +<code> 
 +/Users/<your user>/Library/Application Support/Steam/steamapps/common/SteamVR/SteamVR.app/Contents/MacOS/runtime/drivers/null/resources/settings/default.vrsettings 
 + 
 +/Users/<your user>/Library/Application Support/Steam/steamapps/common/SteamVR/SteamVR.app/Contents/MacOS/runtime/resources/settings/default.vrsettings 
 +</code> 
 + 
 +</WRAP> 
  
 For the floor to be flat, it is good to start steamVR with the controller placed on the floor. The only difference with an HMD setup is the orientation of the space: with an HMD the space will be oriented when you setup the room. Without an HMD the master base station (the one in Mode B) will be at the origin of the space. The Z axis will be the vector normal to the base station window, pointing toward the inside of the base station and rotated around X to be parallel with the floor. For the floor to be flat, it is good to start steamVR with the controller placed on the floor. The only difference with an HMD setup is the orientation of the space: with an HMD the space will be oriented when you setup the room. Without an HMD the master base station (the one in Mode B) will be at the origin of the space. The Z axis will be the vector normal to the base station window, pointing toward the inside of the base station and rotated around X to be parallel with the floor.
Line 28: Line 53:
  
 ''openvr.OpenVRError: b'VRInitError_Init_VRClientDLLNotFound' (error number 102)'' ''openvr.OpenVRError: b'VRInitError_Init_VRClientDLLNotFound' (error number 102)''
 +
 +Or this when running the script from the Crazyflie firmware repos:
 +
 +<code>
 +$ python3 get_bs_position.py 
 +Openning OpenVR
 +python3: Relink `/lib/x86_64-linux-gnu/libudev.so.1' with `/lib/x86_64-linux-gnu/librt.so.1' for IFUNC symbol `clock_gettime'
 +Segmentation fault (core dumped)
 +</code>
  
 Then you are maybe missing some essential packages for openvr: Then you are maybe missing some essential packages for openvr:
Line 34: Line 68:
   * libvulkan-dev   * libvulkan-dev
   * libsdl2-dev   * libsdl2-dev
 +
 +On Ubuntu:
 +
 +<code>
 +$ sudo apt-get install libudev-dev  libvulkan-dev  libsdl2-dev
 +$ python3 -m pip uninstall openvr
 +$ python3 -m pip install openvr
 +</code>
  
 if this still doesn't work, please check this forum-thread for other options: if this still doesn't work, please check this forum-thread for other options:
 [[https://github.com/cmbruns/pyopenvr/issues/30]] [[https://github.com/cmbruns/pyopenvr/issues/30]]
  
 +</WRAP>
 +
 +<WRAP center round info>
 +**Troubleshooting²**
 +
 +When running SteamVR on Linux, by default the access right to USB device might not be configured right. If you have problem connecting the tracker/controller/HMD you can add a udev rules that gives full access to any USB Valve hardware to all users on your system:
 +<code>
 +# cat > /etc/udev/rules.d/99-steamvr.rules << EOF
 +KERNEL=="hidraw*", ATTRS{idVendor}=="28de", MODE=="0666"
 +EOF
 +</code>
 +
 +You may need to restart SteamVR to see the connected devices.
 </WRAP> </WRAP>
  
Line 98: Line 153:
 ===== Space orientation, startup position ===== ===== Space orientation, startup position =====
  
-The orientation of the flying space will follow the orientation of the OpenVR space but in more 'robotic' coordinate system (ie. Crazyflie wants Z to point up!). +The OpenVR uses different coordinate system than the Crazyflie. The Crazyflie coordinate system is used through out the Bitcraze code, but if you want to convert between the two, the following rotation is done from the OpenVR space to the Crazyflie coordinate system:
- +
-The following rotation is done from the OpenVR space to the Crazyflie coordinated system:+
 ^  Crazyflie  ^  OpenVR  ^ ^  Crazyflie  ^  OpenVR  ^
 |             -Z     | |             -Z     |
Line 106: Line 159:
 |              Y     | |              Y     |
  
-This allows to easily orient the Crazyflie when setting up the system with an HMD.+The Lighthouse deck has 4 receivers and can recover its orientation. The Crazyflie can be started in any orientation when using the lighthouse system.  
 + 
 +You can test if the positioning is working by starting the Crazyflie facing X and using the clients "Position hold" mode, this should drift a little bit (mostly in Z) due to an estimator bug, though you should be able to get a quite stable flight and be able to control the Crazyflie position with the gamepad. 
 + 
 +===== The number of basestations and frame synchronization ===== 
 + 
 +The lighthouse deck works with one or two V1 basestations but the estimated position will be better and more stable with two basestations. When using two basestations, one of them may be occluded temporarily, and the Crazyflie will use the other one for positioning.  
 + 
 +The protocol for the lighthouse is composed of frames starting with sync pulses from the basestations. The sync pulses are used to identify which basestation the frame is originating from and this information is essential for correct positioning. When one basestation is occluded, only sync pulses from the visible basestation will be available to the system, which is fine as long as the the system can keep track of the frames. If we loose track of the frames, for instance if both basestations are occluded, the system has to re-synch again to function, but this is a quick process when the basestations are visible. 
 +Due to the design of the lighthouse protocol, visibility to both basestations is always required for synchronization or re-synchronization in a two basestation system. 
 + 
 +===== Position estimation methods =====
  
-While the Lighthouse deck has 4 receiver and so can recover its orientation, this is not implemented yet. So, similarly to when flying in the LPS it is very important to start the Crazyflie with a correct orientation. It should be started with the antenna in the direction of X positive: +There are currently two ways of calculating the position using the lighthouse.
-{{:doc:lps:crazyflie_isometric_drawing_2.png?300|}}+
  
-The safest way to verify the orientation of the space is to look at the estimated position. In the client you can create a new log block in "settings/logging configurationcontaining "stateEstimate.x/y/z". You can then look at it in the plotter and move the Crazyflie around to understand how is X positive oriented:+The first method that was implemented calculates two vectors (or beams) from the basestations, based on the sweep angles measured by the sensors on the Crazyflie. The intersection point between the beams is the position of the Crazyflie, and this point is pushed into the estimatorWe call this method the "crossing beammethod 
 +A more recent implementation pushes the sweep angles from the base stations into the estimator and lets the kalman filter calculate the position based on this information. This method is called the "sweep angle" method and also works if only one basestation is available.  
 +It is possible to change positioning method "on the fly" by setting the lighthouse.method parameter. The sweep angle method is the default.
  
-{{:doc:lighthouse:estimated_potision.png?400|}} 
  
-Once you have located X positive, you can test if the positioning is working by starting the Crazyflie facing X and using the clients "Position hold" mode, this should drift a little bit (mostly in Z) due to an estimator bug, though you should be able to get a quite stable flight and be able to control the Crazyflie position with the gamepad. 
  
  
doc/lighthouse/setup.txt · Last modified: 2020-05-12 14:35 by kimberly