Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
dedc6da
Use input container for lh geo estimator
krichardsson May 15, 2025
03a0b19
Added debug support
krichardsson May 15, 2025
bb6cea9
Added logging
krichardsson May 15, 2025
ecd86e8
LH geo estimation scaling in cflib updated
krichardsson May 16, 2025
16a89f9
Basic continuous lh geo estimation
krichardsson Jun 12, 2025
2d900b0
Adapted to modifications in the lib
krichardsson Jun 13, 2025
e9c5677
Stop solver thread
krichardsson Jun 17, 2025
77cdeca
Adaptations for new sampling method
krichardsson Jun 23, 2025
5cd63e2
First step of integrating geo wizard in lighthouse tab
krichardsson Jun 23, 2025
96ddf1c
Basic functionality in geo wizard widget
krichardsson Jun 24, 2025
00909f3
Improved used feedback
krichardsson Jun 25, 2025
0366878
Added samplinf of xyz-space
krichardsson Jun 25, 2025
94db0bd
Use signal for callback from cflib
krichardsson Jun 27, 2025
f7860e4
Added basic link stats
krichardsson Jun 27, 2025
e78d7eb
Add user feedback when sampling
krichardsson Jul 3, 2025
8dbe099
Added button to sample XYZ-space
krichardsson Jul 3, 2025
a58093a
Show solution error
krichardsson Jul 3, 2025
29bef96
Added file and session management
krichardsson Jul 4, 2025
8138b26
Display samples
krichardsson Jul 8, 2025
77e833f
Make marker axis optional
krichardsson Jul 9, 2025
9dfd90d
Added button for loading geo as well as restore session
krichardsson Jul 9, 2025
26863ad
Clarified text
krichardsson Jul 9, 2025
ed2efd1
Visualize sample positions and add list for samples
krichardsson Jul 14, 2025
ade1797
Added sample delete buttons
krichardsson Jul 15, 2025
3816a28
Added color to table
krichardsson Jul 15, 2025
129c048
Styling table
krichardsson Jul 15, 2025
0d1e732
Added feedback that the solver is running
krichardsson Jul 15, 2025
122fe2a
Support frequent geo uploads
krichardsson Jul 15, 2025
99f94c2
Removed old geo estimation wizard
krichardsson Jul 15, 2025
01fa284
styling
krichardsson Jul 15, 2025
7ad80d0
Fixed table width
krichardsson Jul 15, 2025
c0886cc
Use UID to delete samples instead of index
krichardsson Jul 17, 2025
a05a601
Added basic support for verification samples
krichardsson Jul 18, 2025
eaaf3ca
Added sampling of verification points
krichardsson Jul 18, 2025
4edf901
Colors for verification samples
krichardsson Jul 18, 2025
0b794db
Added bs link stats
krichardsson Jul 18, 2025
cc30d40
styling
krichardsson Jul 19, 2025
7287a2c
Samples in 3D-view can be clicked
krichardsson Jul 24, 2025
85a7175
Use squares for samples
krichardsson Jul 24, 2025
efe109a
Dynamic marker axis visibility
krichardsson Jan 22, 2026
0e8504e
Show sample orientation when highlighted
krichardsson Jan 22, 2026
0e27cb3
Improved selection behavior for samples
krichardsson Jan 22, 2026
1dbd60b
Clear 3D-view selection when new solution is available
krichardsson Jan 22, 2026
831a101
Clear samples when loading a LH system config
krichardsson Jan 22, 2026
8eee1d3
Added simplistic home button to LH 3D view
krichardsson Jan 22, 2026
5fda8d0
Don't reset selection if camera is moved by clicking the plane
krichardsson Jan 22, 2026
2ae4e79
Added table for base station positions in geo estimation
krichardsson Jan 23, 2026
01fc504
Converted delete button for samples to context menu
krichardsson Feb 2, 2026
7d683f7
Converted sample type change button to context menu
krichardsson Feb 2, 2026
3c59097
refactoring
krichardsson Feb 2, 2026
47f302f
Added checkbox for toggling base station details
krichardsson Feb 2, 2026
8647a1e
Moved import/export buttons and removed restore session button
krichardsson Feb 2, 2026
ca0088f
Removed old geometry dialog
krichardsson Feb 2, 2026
f23e9f9
Reorganized the System Management UI
krichardsson Feb 2, 2026
606fbb6
Break out samples and bs from GeoEstimatorWidget into separate widget
krichardsson Feb 2, 2026
bd57211
Updated solution status box
krichardsson Feb 3, 2026
40038f9
Show special upload message when geometry is loaded from file (comple…
krichardsson Feb 3, 2026
4b693a7
Updated the steps box
krichardsson Feb 3, 2026
6decc7b
Cleaned up imports
krichardsson Feb 3, 2026
b7c8a80
Added dummy icons to steps
krichardsson Feb 3, 2026
8f36e48
Added info boxes
krichardsson Feb 4, 2026
0271033
Moved home button into 3d plot class
krichardsson Feb 4, 2026
b9b71aa
Removed the drone view button after a failed attempt to implement it.
krichardsson Feb 5, 2026
e42d914
Reworked sample/bs details
krichardsson Feb 5, 2026
acca017
Moved system management back to the right of bs status
krichardsson Feb 5, 2026
bfce878
Moved details checkbox into solution status box
krichardsson Feb 5, 2026
f20cdc5
Moved geometry more radio buttons to under CF status
krichardsson Feb 5, 2026
cb733d5
Updated images
krichardsson Feb 6, 2026
4887fa2
Updated texts when taking samples
krichardsson Feb 6, 2026
a2b296f
Cleaned up solution status box
krichardsson Feb 6, 2026
25b60a5
Better pop up menu text for changing sample type
krichardsson Feb 6, 2026
644a41d
Show pending color when sampling on the floor
krichardsson Feb 6, 2026
b164653
Flake 8
krichardsson Feb 6, 2026
d9e52c8
Merge commit '6de7eefff588ae5dcb0e6340da5a5c7badc6dbc2' into krichard…
krichardsson Feb 9, 2026
4f27dfc
First steps of joes new design
enyanil Apr 2, 2026
0e96b0f
Second half of Joes updates
enyanil Apr 8, 2026
88840bc
Updated images and adapt to themes
enyanil Apr 13, 2026
968da46
Merge branch 'master' into krichardson/umwelt
ArisMorgens Jun 24, 2026
34b8533
Fixed long-line violations
ArisMorgens Jun 24, 2026
457a2ba
Added Delete base station button
ArisMorgens Jun 25, 2026
5801ab1
Updates after testing
enyanil Jun 26, 2026
c2cb5d8
toml file change
enyanil Jun 29, 2026
9546c22
failing ci long lines fix
enyanil Jun 29, 2026
856a476
Locked change type button for certain samples
enyanil Jun 29, 2026
d93d461
Added guard for _lh_memory_helper to prevent getting stuck at the upl…
ArisMorgens Jun 30, 2026
51b5327
Updated user notification with Color LED, LED-ring, and Buzzer deck f…
ArisMorgens Jun 30, 2026
bb21410
Removed the fourth row in the Basestation Status section
ArisMorgens Jun 30, 2026
d23b999
syncing steps on reopening setup window
enyanil Jun 30, 2026
9e57872
Added cf_disconnected_cb to properly close the lighthouse setup upon …
ArisMorgens Jun 30, 2026
3582dfe
tooltip updates
enyanil Jun 30, 2026
fabf1db
Introduced the estimation samples, as the terminology for all the sam…
ArisMorgens Jul 1, 2026
83123a7
Refined the lighthouse_tab.md
ArisMorgens Jul 2, 2026
ae56c48
Updated cfclient_lh_main.png
ArisMorgens Jul 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed docs/images/base_station_geo_dialog.png
Binary file not shown.
Binary file modified docs/images/cfclient_lh_main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/cfclient_lh_setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
150 changes: 101 additions & 49 deletions docs/userguides/userguide_client/lighthouse_tab.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,80 +5,132 @@ sort_order: 10
---

The Lighthouse Positioning tab shows information from the Lighthouse Positioning
system when present. It is also used to configure and manage the system.
system when present. It is also used to set up and manage the system. To properly set up your system, please follow the [getting started tutorial](https://www.bitcraze.io/documentation/tutorials/getting-started-with-lighthouse/).
For more information on how the Lighthouse system works, please see
[the firmware documentation](https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/functional-areas/lighthouse/).

![cfclient positioning](/docs/images/cfclient_lh_main.png)

The tab is divided into four sections:
1. 3D view of the Crazyfle and the base stations
1. 3D view of the Crazyflie and the base stations
2. Crazyflie Status
3. Base stations status
4. System management
3. Base Station Status
4. System Management

### 3D view
The view shows the position and orientation of the Crazyflie (blue) and the
base stations (green). The ids of the base stations are displayed as a number and
the status using colors. Green means that data from the base station is used
in the position estimation.

The graph can be rotated by clicking and draging, zoomed using the scroll wheel
and moved by holding the shift key while clicking and draging.
### 1. 3D view
The view displays the position and orientation of the Crazyflie (blue dot) and the base stations. Each base station is labeled with its ID, and its status is indicated by color:
* Green = signals are received
* Red = no reception

### Crazyflie status
### 2. Crazyflie Status
The overall status of the Lighthouse system is displayed as a text. The status is one of:
* **LH ready** - one or more base stations are received and the information is used to estimate the position of the Crazyflie
* **Not receiving** - no base station is received
* **No geo/calib** - calibration or geometry data is missing and position can not be estimated
* **LH ready** - one or more base stations are received and the information is used to estimate the position of the Crazyflie.
* **Not receiving** - no base station is received.
* **No geo/calib** - calibration or geometry data is missing and position can not be estimated.

The currently estimated position is displayed in the "Position" field.
The estimated (x, y, z) position for the Crazyflie is displayed in the "Position" field in meters.

### Base station status
A detailed status of the base stations is indicated using colors in the grid. All
four stages for a base station must be green for the data to be used in the position
estimation process. When setting up the system, work from top to bottom and make sure all the boxes above are green
before you proceed to the next one.
### 3. Base Station Status
A detailed status of the base stations is indicated using colors in the grid.

1. **Receiving** - green = light is received from the base station, red = no reception
2. **Calibration** - indicates if there is calibration data for the base station or not.
1. **Receiving** - indicates that the Crazyflie is receiving signals from the base station.
* Green = signals are received
* Red = no reception
2. **Calibration** - indicates if there is calibration data for the base station or not.
* Red = no calibration data
Comment thread
ArisMorgens marked this conversation as resolved.
* blue = calibration data from persistent storage but not yet confirmed
* green = calibration data has been received from the base station and matched previous data
* orange = calibration data has been received from the base station but did **not** match the previous data, this means that you probably should redo the geometry estimation.
* Blue = calibration data from persistent storage but not yet confirmed
* Green = calibration data has been received from the base station and matched previous data
* Orange = calibration data has been received from the base station but did **not** match the previous data, this means that you might need to redo the geometry estimation.

**Note:** when Calibration data is received it is automatically stored in the persistent memory to be available after reboot.
3. **Geometry** - indicates whether geometry data is available or not.
* Green = geometry data from persistent storage or has been set from the client
* red = no geometry data.
Note: it is possible that the geometry indicator is green even though the geometry data is not valid, this is for instance the case if a base station is moved in a stystem that has been set up earlier.
4. **Estimator** - data from the base station is sent to the estimator to be used in the position estimation process.
Note: when Calibration data is received it is automatically stored in the persistent memory to be available immediately after reboot.
* Green = geometry data from persistent storage
* Red = no geometry data.

**Note:** it is possible that the geometry indicator is green even though the geometry data is not valid, this is for instance the case if a base station is replaced by another one with the same channel.

### System Management
This section us used to configure the system.
### 4. System Management
This section is used to configure the system.

* **Manage Geometry** - Opens a dialog box displaying the current geometry data. See the [Basestation Geometry Management](#basestation-geometry-management) section.
* **Start set up** - Expands the Lighthouse tab with new sections for setting up a Lighthouse positioning system. See the [System Set up](#system-set-up) section.

* **Change system type** - Opens a dialog box where the system type can be changed.
* **Switch BS version** - Opens a dialog box where the base station version can be changed.
Comment thread
ArisMorgens marked this conversation as resolved.
Possible options are **Lighthouse V1** and **Lighthouse V2**.
Note: calibration and geometry data is erased when the system type is changed.

* **Set BS channel** - Opens a dialog box that is used to set the channel of a Lighthouse V2
base station. Connect **one** base station at a time to the computer via USB and click
the **Scan basestation** button. If a base station is detected, a new channel
the **Scan base station** button. If a base station is detected, a new channel
can be set by choosing the desired channel and clicking the “Set channel” button.

* **Save system config**/**Load system config** - store and load system configuration
to/from file. The system configuration contains system type, calibration and
geometry data. When a system configuration is loaded from file it is automatically
written to the Crazyflie (and is stored in persistent memory). This is a
useful feature when configuring multiple Crazyflies for a system to make sure
they all share the same coordinate system.
* **Import configuration** - upload a system configuration to the Crazyflie from a file. The system configuration contains system type, calibration and geometry data. When a system configuration is uploaded from a file it is automatically written to the Crazyflie (and is stored in persistent memory). This is a useful feature when configuring multiple Crazyflies, making sure they all share the same coordinate system.
* **Export configuration** - store a system configuration from the Crazyflie to a file.

### Basestation Geometry Management

![cfclient positioning](/docs/images/base_station_geo_dialog.png){:align-center width="700"}
### System Set up

![cfclient positioning](/docs/images/cfclient_lh_setup.png)

When setting up the system, four new sections appear:

5. Sample collection
6. Sample management

When **show sample details** is activated:

7. Base stations table
Comment thread
ArisMorgens marked this conversation as resolved.
8. Samples table

#### 5. Sample Collection
This section guides you through collecting the position samples used to estimate the geometry of the base stations.
The process follows a fixed sequence of five steps:

* **Origin sample** - Place the Crazyflie at the desired origin of your coordinate system and take a measurement.
* **X-axis sample** - Place the Crazyflie 1m along the positive X-axis from the origin and take a measurement.
* **XY-plane samples** - Place the Crazyflie anywhere in the XY-plane (but not on the X-axis) and take one or more measurements. This maps the XY-plane to the floor.
* **XYZ-space samples** - Carry the Crazyflie to positions within the intended flight space and take samples by quickly rotating it left–right around the Z-axis, then holding it still.
* **Verification samples** (optional) - Taken the same way as XYZ-space samples. Used to check the accuracy of the geometry estimate at locations not used during estimation.

Use the arrow buttons "**<**" and "**>**" to navigate between steps.
The large button between the arrow buttons triggers the measurement for the current step.
For the first three steps, a step icon shows a checkmark when enough data has been collected for a valid solution.

A status label at the bottom of the section reflects the current state of the geometry solution:
* **Not enough samples** - more samples are needed before a solution can be computed.
* **Updating...** - the solver is recalculating the geometry.
* **Uploading...** - a valid solution has been found and is being written to the Crazyflie.
* **Uploaded** - the geometry has been successfully written to and confirmed by the Crazyflie.
* **Uploaded (imported config)** - a configuration was loaded from file and written to the Crazyflie.


#### 6. Sample Management
This section shows the quality of the current geometry solution and provides tools for managing the collected samples.

* **Sample Details** - Toggle **Show**/**Hide** to reveal or collapse the [Base Stations](#base-stations-table) and [Samples](#samples-table) tables.
* **Max Estimation Sample Error** - The maximum [crossing-beam](https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/functional-areas/lighthouse/positioning_methods/#crossing-beams) error across all estimation samples. The estimation samples include the origin, X-axis, XY-plane, and XYZ-space samples.
* **Max Verification Sample Error** - The maximum crossing-beam error across all verification samples. Gives a practical measure of accuracy at positions not used during estimation.
* **Clear all samples** - Discards all collected samples and starts a fresh session.
* **Import samples** - Loads a previously saved sample session from a YAML file.
* **Export samples** - Saves the current sample session to a YAML file for later reuse or sharing between Crazyflies.

#### 7. Base Stations table
Visible when **Sample Details** is set to **Show**.
Displays a table of all base stations detected from the collected samples, with columns:
**Id**, **X**, **Y**, **Z** (estimated position in metres), **Samples** (number of samples that saw this base station), and **Links** (number of connections to other base stations).
A red highlight in the **Links** column means too few links exist, which prevents a valid geometry solution.

* **Delete** - Removes the selected base station and all its connections from the estimation. Samples that only observed this base station and one other are also removed.

#### 8. Samples table
Visible when **Sample Details** is set to **Show**.
Displays a table of all collected samples, with columns:
**Type**, **X**, **Y**, **Z** (estimated position in metres), and **Err** (crossing-beam error in mm).
Verification samples are shown with a yellow background.
A large error in the **Err** column is highlighted in red; adding more XYZ-space samples nearby or retaking the affected sample can reduce it.

* **Delete** - Removes the selected sample from the table and the solution.
* **Change Type** - Switches the selected sample between XYZ-space and Verification type.

Estimation and Verification samples are also drawn in the 3D view, represented by grey and white squares respectively.
Comment thread
ArisMorgens marked this conversation as resolved.


1. This shows the current geometry of the basestations that are saved in the Crazyflie's memory. Either it is empty (no geometry in memory), or there are positions, or there are replacement postions. If you see an arrow like `N/A -> 2.3` or `2.0 -> 2.3`, that means that you just estimated a (new) basestation geometry but it has not been saved to the Crazyflie's permanent memory yet.
2. *Estimate geometry*: This will open a wizard that will follow you through the steps of estimating the positions of the installed basestations. Check out the [getting started tutorial](https://www.bitcraze.io/documentation/tutorials/getting-started-with-lighthouse/) for more instructions. This is meant for 2+ basestations
3. *Estimate geometry simple*. This is a simplerer basetation geometry estimation based on the PnP function of OpenCV. If it is grayed out, install `pip3 install opencv-python-headless`, but just beware of the incompatibility issues with the regular opencv python packages. This is meant for 1-2 basestations.
4. *Write to Crazyflie*: This will write the just estimated basestation geometry (in (1) behind the arrow)) to the permanent memory of the Crazyflie.
8 changes: 4 additions & 4 deletions src/cfclient/ui/dialogs/basestation_mode_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
Toolbox used to interact with the Basestation to set it in a certain channel
Toolbox used to interact with the Base station to set it in a certain channel
"""

from PyQt6 import QtWidgets
Expand Down Expand Up @@ -64,14 +64,14 @@ def __init__(self, helper, *args):
self._channel = 1
self._device = None

self._basestation_port_display.setText('No basestation found!')
self._basestation_port_display.setText('No base station found!')

self._basestation_port_display.setText(self._device)

def _set_basestation_dev(self):
self._device = self._find_basestation()
if self._device is None:
self._basestation_port_display.setText('No basestation found!')
self._basestation_port_display.setText('No base station found!')
self._set_basestation_button.setEnabled(False)
self._display_current_channel.setText('')
self._display_current_id.setText('')
Expand Down Expand Up @@ -178,7 +178,7 @@ def reset(self):
self._channel = 1
self._device = None
self._set_basestation_button.setEnabled(False)
self._basestation_port_display.setText('No basestation found!')
self._basestation_port_display.setText('No base station found!')
self._display_current_channel.setText('')
self._basestation_mode_status.setText('')
self._set_channel_spinbox.setValue(self._channel)
Expand Down
8 changes: 4 additions & 4 deletions src/cfclient/ui/dialogs/basestation_mode_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Basestation configuration</string>
<string>Base station configuration</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
Expand All @@ -27,7 +27,7 @@
</font>
</property>
<property name="text">
<string>Lighthouse V2 Basestation Configuration Tool</string>
<string>Lighthouse V2 Base Station Configuration Tool</string>
</property>
</widget>
</item>
Expand All @@ -42,7 +42,7 @@
</font>
</property>
<property name="text">
<string>Connect only 1 basestation with a micro usb at the time </string>
<string>Connect only 1 base station with a micro usb at the time </string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -78,7 +78,7 @@
<item row="1" column="1">
<widget class="QPushButton" name="_scan_basestation_button">
<property name="text">
<string>Scan basestation</string>
<string>Scan base station</string>
</property>
</widget>
</item>
Expand Down
Loading
Loading