lighthouse_geo_estimation_manager


Classes

LhGeoEstimationManager

LhGeoEstimationManager()

Class variables

ESTIMATION_TYPES

REFERENCE_DIST

SolverThread

This class runs the geometry solver in a separate thread. It is used to provide continuous updates of the solution as well as updating the geometry in the Crazyflie.


Static methods

def align_and_scale_solution(container: LhGeoInputContainerData, solution: LighthouseGeometrySolution, samples: list[LhCfPoseSampleWrapper], reference_distance: float)

def estimate_geometry(container: LhGeoInputContainerData) > cflib.localization.lighthouse_geometry_solution.LighthouseGeometrySolution

Estimate the geometry of the system based on samples recorded by a Crazyflie


LhGeoInputContainer

LhGeoInputContainer(sensor_positions: ArrayFloat)

This class holds the input data required by the geometry estimation functionality.


Class variables

FILE_TYPE_VERSION

Static methods

def save_data_container_as_yaml(container_data: LhGeoInputContainerData, text_io: TextIO)

Save the data container as a YAML string suitable for saving to a file

Args: container_data (LhGeoInputContainerData): The data container to save text_io (TextIO): The text IO stream to write the YAML data to


Methods

def append_verification_samples(self, samples: list[LhCfPoseSample]) > NoneType

Append to the samples for verification

Args: samples (list[LhCfPoseSample]): the new samples


def append_xy_plane_sample(self, xy_plane: LhCfPoseSample) > NoneType

append to the samples to be used for the xy-plane

Args: xy_plane (LhCfPoseSample): the new xy-plane sample


def append_xyz_space_samples(self, samples: list[LhCfPoseSample]) > NoneType

Append to the samples for the xyz space

Args: samples (list[LhMeasurement]): the new samples


def clear_all_samples(self) > NoneType

Clear all samples in the container


def convert_to_verification_sample(self, uid: int) > NoneType

Convert a sample to a verification sample by UID. Only xyz-space samples can be converted. The mandatory samples used for the origin, x-axis and xy-plane can not be converted, since they are required for the geometry estimation. The sample will be moved to the verification list and removed from the xyz-space list.

Args: uid (int): The UID of the sample to convert


def convert_to_xyz_space_sample(self, uid: int) > NoneType

Convert a sample to a xyz-space sample by UID. The sample will be moved to the xyz-space list and removed from the verification list.

Args: uid (int): The UID of the sample to convert


def enable_auto_save(self, session_path: str = '/home/jenkins/agent/workspace/Release-docker-int-web/website/bitcraze-website-2026-08-24T13.01.56/tmp/crazyflie-lib-python-0.1.33') > NoneType

Enable auto-saving of the session data to a file in the specified path. Session files will be named with the current date and time.

Args: session_path (str): The path to save the session data to. Defaults to the current working directory.


def get_data_copy(self) > cflib.localization.lighthouse_geo_estimation_manager.LhGeoInputContainerData

Get a copy of the data in the container

Returns: LhGeoInputContainerData: A copy of the data in the container


def get_data_version(self) > int

Get the current data version

Returns: int: The current data version


def is_empty(self) > bool

Check if the container is empty

Returns: bool: True if the container is empty, False otherwise


def populate_from_file_yaml(self, text_io: TextIO) > NoneType

Load the data from file

Args: text_io (TextIO): The text IO stream to read the YAML data from Raises: ValueError: If the file type version is not supported


def remove_base_station(self, bs_id: int) > NoneType

Remove a base station from the container, as if it had never been part of the system.

The base station is stripped from the angles of every sample. Samples that only had two base stations, one of them being the removed one, no longer carry enough information and are removed entirely.

Args: bs_id (int): The id of the base station to remove


def remove_sample(self, uid: int) > NoneType

Remove a sample from the container by UID.

Args: uid (int): The UID of the sample to remove


def save_as_yaml_file(self, text_io: TextIO)

Save the data container as a YAML file

Args: text_io (TextIO): The text IO stream to write the YAML data to


def set_origin_sample(self, origin: LhCfPoseSample) > NoneType

Store/update the sample to be used for the origin

Args: origin (LhCfPoseSample): the new origin


def set_x_axis_sample(self, x_axis: LhCfPoseSample) > NoneType

Store/update the sample to be used for the x_axis

Args: x_axis (LhCfPoseSample): the new x-axis sample


def set_xy_plane_samples(self, xy_plane: list[LhCfPoseSample]) > NoneType

Store/update the samples to be used for the xy-plane

Args: xy_plane (list[LhCfPoseSample]): the new xy-plane samples


def set_xyz_space_samples(self, samples: list[LhCfPoseSample]) > NoneType

Store/update the samples for the xyz space

Args: samples (list[LhMeasurement]): the new samples


def verification_sample_count(self) > int

Get the number of samples used for verification

Returns: int: The number of samples used for verification


def xy_plane_sample_count(self) > int

Get the number of samples in the xy-plane

Returns: int: The number of samples in the xy-plane


def xyz_space_sample_count(self) > int

Get the number of samples in the xyz space

Returns: int: The number of samples in the xyz space


LhGeoInputContainerData

LhGeoInputContainerData(sensor_positions: ArrayFloat, version: int = 0)

Class variables

EMPTY_POSE_SAMPLE

Static methods

def yaml_constructor(loader, node)

def yaml_representer(dumper, data: LhGeoInputContainerData)

Instance variables

origin_index: int

Get the index of the origin sample in the list of samples


x_axis_sample_count: int

Get the count of x-axis samples in the list of samples


x_axis_slice: slice

Get the slice for the x-axis samples in the list of samples


x_axis_start_index: int

Get the index of the first x-axis sample in the list of samples


xy_plane_sample_count: int

Get the count of xy-plane samples in the list of samples


xy_plane_slice: slice

Get the slice for the xy-plane samples in the list of samples


xy_plane_start_index: int

Get the index of the first xy-plane sample in the list of samples


xyz_space_sample_count: int

Get the count of xyz-space samples in the container


xyz_space_start_index: int

Get the index of the first xyz-space sample in the list of samples


Methods

def get_matched_samples(self) > list[cflib.localization.lighthouse_cf_pose_sample.LhCfPoseSampleWrapper]

Get all pose samples collected in a list

Returns: list[LhCfPoseSampleWrapper]: A list of pose samples wrapped in LhCfPoseSampleWrapper


def is_empty(self) > bool

Check if the container is empty, meaning no samples are set

Returns: bool: True if the container is empty, False otherwise