This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
doc:lighthouse:setup [2019-03-08 07:53] arnaud [Space orientation, startup position] |
doc:lighthouse:setup [2020-05-12 14:35] (current) kimberly |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <WRAP center round important 60%> | ||
+ | This page has deprecated and moved to the new documentation framework of the main Bitcraze website. Please go to [[https:// | ||
+ | </ | ||
+ | |||
====== Setting up the lighthouse deck ====== | ====== Setting up the lighthouse deck ====== | ||
Line 5: | Line 9: | ||
The lighthouse deck allows to use the HTC-Vive/ | The lighthouse deck allows to use the HTC-Vive/ | ||
- | The VR computer must have [[https:// | + | The VR computer must have [[https:// |
- | In order to setup the system you must also be able to compile a custom firmware for your Crazyflie and to program your Crazyflie 2.X. To do so youcan | + | In order to setup the system you must also be able to compile a custom firmware for your Crazyflie and to program your Crazyflie 2.X. To do so you can follow the [[https:// |
===== Setting up SteamVR without Head Mounted Display ===== | ===== Setting up SteamVR without Head Mounted Display ===== | ||
Line 13: | Line 17: | ||
If you already have a setup VR system jump to the next section. | If you already have a setup VR system jump to the next section. | ||
- | It is possible to setup the SteamVR without a Head Mounted Display (HDM). 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:// | + | Follow the guide from Triad: [[http:// |
- | The only difference with an HDM setup is the orientation of the space: with an HDM the space will be oriented when you setup the room. Without an HDM the slave base station (the one in Mode A or C) will be at the origin of the space and the Z axis will be normal to the base station window. | + | <WRAP center round info> |
+ | **OSX** | ||
- | ===== Setting up the space origin and orientation with an HDM ===== | + | The osx implementation seems to be a bit shaky, but it is possible to make it work. I used the " |
+ | |||
+ | The paths in the triad instructions are for Windows. On Mac OSX you will find the files to update in | ||
+ | |||
+ | < | ||
+ | / | ||
+ | |||
+ | / | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | 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. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | <WRAP center round info> | ||
+ | **Troubleshooting** | ||
+ | |||
+ | If you get the following message when running the tracker_test.py script of the tutorial (step 16): | ||
+ | |||
+ | '' | ||
+ | |||
+ | Or this when running the script from the Crazyflie firmware repos: | ||
+ | |||
+ | < | ||
+ | $ python3 get_bs_position.py | ||
+ | Openning OpenVR | ||
+ | python3: Relink `/ | ||
+ | Segmentation fault (core dumped) | ||
+ | </ | ||
+ | |||
+ | Then you are maybe missing some essential packages for openvr: | ||
+ | |||
+ | * libudev-dev | ||
+ | * libvulkan-dev | ||
+ | * libsdl2-dev | ||
+ | |||
+ | On Ubuntu: | ||
+ | |||
+ | < | ||
+ | $ sudo apt-get install libudev-dev | ||
+ | $ python3 -m pip uninstall openvr | ||
+ | $ python3 -m pip install openvr | ||
+ | </ | ||
+ | |||
+ | if this still doesn' | ||
+ | [[https:// | ||
+ | |||
+ | </ | ||
+ | |||
+ | <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/ | ||
+ | < | ||
+ | # cat > / | ||
+ | KERNEL==" | ||
+ | EOF | ||
+ | </ | ||
+ | |||
+ | You may need to restart SteamVR to see the connected devices. | ||
+ | </ | ||
+ | |||
+ | ===== Setting up the space origin and orientation with an HMD ===== | ||
When using a full VR setup, SteamVR has a developer menu that allows to quickly and accurately setup the system origin and orientation. By default the system origin is going to be placed in the center of the playground and the orientation will depend of the shape and of where the monitor is located. | When using a full VR setup, SteamVR has a developer menu that allows to quickly and accurately setup the system origin and orientation. By default the system origin is going to be placed in the center of the playground and the orientation will depend of the shape and of where the monitor is located. | ||
- | To set the orientation and origin yourself, you can go to the SteamVR settings, to the developer subscreen and you can display the room overview. Then you can place the HDM on the floor, with the front pointing at where you want the Crazyflie X axis to point, and then click 'Quick Calibrate': | + | To set the orientation and origin yourself, you can go to the SteamVR settings, to the developer subscreen and you can display the room overview. Then you can place the HMD on the floor, with the front pointing at where you want the Crazyflie X axis to point, and then click 'Quick Calibrate': |
{{: | {{: | ||
===== Getting the base station position and programming the Crazyflie ===== | ===== Getting the base station position and programming the Crazyflie ===== | ||
- | Launch SteamVR and make sure at least one controller or the HDM is tracking: | + | Launch SteamVR and make sure at least one controller or the HMD is tracking: |
{{: | {{: | ||
Line 34: | Line 105: | ||
Clone or download the latest version or the [[https:// | Clone or download the latest version or the [[https:// | ||
< | < | ||
- | pip install openvr | + | python3 -m pip install openvr |
cd tools\lighthouse | cd tools\lighthouse | ||
- | python | + | python3 |
</ | </ | ||
Line 51: | Line 122: | ||
</ | </ | ||
- | <WRAP center round info 80%> | + | <WRAP center round info> |
- | **Note**: If you have a setup without | + | **Note**: If you have a setup without |
</ | </ | ||
- | Copy the last two lines and, on the computer or virtual machine you use for Crazyflie development, | + | Copy the last two lines and, on the computer or virtual machine you use for Crazyflie development, |
{{: | {{: | ||
<code c> | <code c> | ||
- | // # | + | // #ifndef DISABLE_LIGHTHOUSE_DRIVER |
+ | // # | ||
+ | // #endif | ||
baseStationGeometry_t baseStationsGeometry[] = { | baseStationGeometry_t baseStationsGeometry[] = { | ||
Line 67: | Line 140: | ||
</ | </ | ||
- | Now that the Crazyflie firmware is modified | + | Now that the Crazyflie firmware is modified you can save, compile and program the Crazyflie. For example this can be done from command line with: |
< | < | ||
make | make | ||
Line 75: | Line 148: | ||
===== Space orientation, | ===== Space orientation, | ||
- | The orientation of the flying space will follow the orientation of the OpenVR | + | The OpenVR |
- | + | ||
- | The following rotation is done from the OpenVR space to the Crazyflie | + | |
^ Crazyflie | ^ Crazyflie | ||
| | | | ||
Line 83: | Line 154: | ||
| | | | ||
- | This allows | + | 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 " | ||
+ | |||
+ | ===== 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, | ||
+ | |||
+ | 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 | ||
+ | Due to the design of the lighthouse protocol, visibility to both basestations is always required for synchronization or re-synchronization in a two basestation | ||
+ | |||
+ | ===== Position estimation methods ===== | ||
- | While the Lighthouse deck has 4 receiver and so can recover its orientation, | + | There are currently two ways of calculating |
- | {{: | + | |
- | The safest way to verify | + | The first method that was implemented calculates two vectors (or beams) from the basestations, |
+ | A more recent implementation pushes | ||
+ | It is possible | ||
- | {{: | ||
- | Once you have located X positive, you can test if the positioning is working by starting the Crazyflie facing X and using the clients " | ||