Auterion App SDK
Auterion SDK is a library that can be used by AuterionOS apps to communicate with the system.
Loading...
Searching...
No Matches
los_filter.hpp
1/****************************************************************************
2 *
3 * Copyright (c) 2024 PX4 Development Team. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
14 * distribution.
15 * 3. Neither the name PX4 nor the names of its contributors may be
16 * used to endorse or promote products derived from this software
17 * without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 *
32 ****************************************************************************/
33
34#pragma once
35
36#include <Eigen/Eigen>
37#include <memory>
38
39namespace auterion {
40
47class LosFilterImpl;
48
57class LosFilter {
58 public:
65
69 void init();
70
78 void init(const Eigen::Vector3f& los_init, float los_std_init = 0.1f,
79 float los_rate_std_init = 0.1f);
80
86 bool isInitialized() const;
87
91 void reset();
92
100 void predict(float dt, float los_rate_process_nsd = 0.1f);
101
108 void update(const Eigen::Vector3f& los_measurement, float los_variance);
109
115 Eigen::Vector3f getLOS() const;
116
122 Eigen::Vector3f getLOSRate() const;
123
129 const Eigen::MatrixXf getCovariance() const;
130
136 Eigen::Vector3f getLOSInnov() const;
137
143 Eigen::Vector3f getLOSInnovVar() const;
144
150 Eigen::MatrixXf getStateVariance() const;
151
157 Eigen::MatrixXf getLOSVariance() const;
158
164 Eigen::MatrixXf getLOSRateVariance() const;
165
166 private:
167 std::shared_ptr<LosFilterImpl> _impl;
168};
169
170} // namespace auterion
Implementation details for the Line Of Sight Filter class.
A filter for estimating Line-of-Sight (LOS) vectors and their rates.
Definition los_filter.hpp:57
Eigen::Vector3f getLOSRate() const
Gets the current estimated LOS rate.
Eigen::MatrixXf getStateVariance() const
Gets the state variance matrix.
void init(const Eigen::Vector3f &los_init, float los_std_init=0.1f, float los_rate_std_init=0.1f)
Initializes the filter with a given LOS vector.
Eigen::MatrixXf getLOSRateVariance() const
Gets the variance of the LOS rate estimates.
Eigen::Vector3f getLOSInnovVar() const
Gets the variance of the LOS innovation.
const Eigen::MatrixXf getCovariance() const
Gets the covariance matrix of the state.
Eigen::MatrixXf getLOSVariance() const
Gets the variance of the LOS estimates.
Eigen::Vector3f getLOS() const
Gets the current estimated LOS vector.
LosFilter()
Default constructor.
void update(const Eigen::Vector3f &los_measurement, float los_variance)
Updates the filter state with a new LOS measurement.
void init()
Initializes the filter without an initial LOS vector.
void reset()
Resets the filter to the uninitialized state, clearing state and covariance.
void predict(float dt, float los_rate_process_nsd=0.1f)
Predicts the next state of the filter based on elapsed time.
Eigen::Vector3f getLOSInnov() const
Gets the LOS innovation (difference between measurement and prediction).
bool isInitialized() const
Checks whether the filter has been initialized.