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
71 void init();
72
78 void init(const Eigen::Vector3f& los_init);
79
85 void predict(float dt);
86
93 void update(const Eigen::Vector3f& los_measurement, float los_variance);
94
100 Eigen::Vector3f getLOS() const;
101
107 Eigen::Vector3f getLOSRate() const;
108
114 const Eigen::MatrixXf getCovariance() const;
115
121 Eigen::Vector3f getLOSInnov() const;
122
128 Eigen::Vector3f getLOSInnovVar() const;
129
135 Eigen::MatrixXf getStateVariance() const;
136
142 Eigen::MatrixXf getLOSVariance() const;
143
149 Eigen::MatrixXf getLOSRateVariance() const;
150
151 private:
152 std::shared_ptr<LosFilterImpl> _impl;
153};
154
155} // 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 predict(float dt)
Predicts the next state of the filter based on elapsed time.
Eigen::MatrixXf getLOSRateVariance() const
Gets the variance of the LOS rate estimates.
void init(const Eigen::Vector3f &los_init)
Initializes the filter with a given LOS vector.
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.
Eigen::Vector3f getLOSInnov() const
Gets the LOS innovation (difference between measurement and prediction).