Auterion App SDK
Auterion SDK is a library that can be used by AuterionOS apps to communicate with the system.
Loading...
Searching...
No Matches
frame_conversion.hpp
1/****************************************************************************
2 *
3 * Copyright 2024 Auterion AG. 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 are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice, this
9 * list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its contributors
16 * may be used to endorse or promote products derived from this software without
17 * specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 *
31 ****************************************************************************/
32
33#pragma once
34
35#include <Eigen/Eigen>
36
37namespace auterion {
50Eigen::Quaternionf attitudeNedToEnu(const Eigen::Quaternionf& q_ned);
51Eigen::Quaterniond attitudeNedToEnu(const Eigen::Quaterniond& q_ned);
52
61Eigen::Quaternionf attitudeEnuToNed(const Eigen::Quaternionf& q_enu);
62Eigen::Quaterniond attitudeEnuToNed(const Eigen::Quaterniond& q_enu);
63
72Eigen::Quaternionf attitudeFrdToFlu(const Eigen::Quaternionf& q_frd);
73Eigen::Quaterniond attitudeFrdToFlu(const Eigen::Quaterniond& q_frd);
74
83Eigen::Quaternionf attitudeFluToFrd(const Eigen::Quaternionf& q_flu);
84Eigen::Quaterniond attitudeFluToFrd(const Eigen::Quaterniond& q_flu);
85
95Eigen::Vector3f yawBodyToWorld(float yaw, const Eigen::Vector3f& point_body);
96Eigen::Vector3d yawBodyToWorld(double yaw, const Eigen::Vector3d& point_body);
97
104float yawNedToEnu(const float yaw_ned_rad);
105double yawNedToEnu(const double yaw_ned_rad);
106
113float yawEnuToNed(const float yaw_enu_rad);
114double yawEnuToNed(const double yaw_enu_rad);
115
122float yawRateNedToEnu(const float yaw_rate_ned);
123double yawRateNedToEnu(const double yaw_rate_ned);
124
131float yawRateEnuToNed(const float yaw_rate_enu);
132double yawRateEnuToNed(const double yaw_rate_enu);
133
140Eigen::Vector3f positionNedToEnu(const Eigen::Vector3f& ned);
141Eigen::Vector3d positionNedToEnu(const Eigen::Vector3d& ned);
142Eigen::Vector2f positionNedToEnu(const Eigen::Vector2f& ne);
143Eigen::Vector2d positionNedToEnu(const Eigen::Vector2d& ne);
144
151Eigen::Vector3f positionEnuToNed(const Eigen::Vector3f& enu);
152Eigen::Vector3d positionEnuToNed(const Eigen::Vector3d& enu);
153Eigen::Vector2f positionEnuToNed(const Eigen::Vector2f& en);
154Eigen::Vector2d positionEnuToNed(const Eigen::Vector2d& en);
155
162Eigen::Vector3f frdToFlu(const Eigen::Vector3f& frd);
163Eigen::Vector3d frdToFlu(const Eigen::Vector3d& frd);
164
171Eigen::Vector3f fluToFrd(const Eigen::Vector3f& flu);
172Eigen::Vector3d fluToFrd(const Eigen::Vector3d& flu);
173
180Eigen::Vector3f varianceNedToEnu(const Eigen::Vector3f& v_ned);
181Eigen::Vector3d varianceNedToEnu(const Eigen::Vector3d& v_ned);
182
189Eigen::Vector3f varianceEnuToNed(const Eigen::Vector3f& v_enu);
190Eigen::Vector3d varianceEnuToNed(const Eigen::Vector3d& v_enu);
191
193} // namespace auterion
float yawRateNedToEnu(const float yaw_rate_ned)
Converts yaw rate from NED to ENU frame.
Eigen::Quaternionf attitudeEnuToNed(const Eigen::Quaternionf &q_enu)
Converts attitude from ENU to NED frame. Performs reference frame change and quaternion rotation s....
Eigen::Vector3f frdToFlu(const Eigen::Vector3f &frd)
Converts coordinates from FRD to FLU frame.
Eigen::Vector3f fluToFrd(const Eigen::Vector3f &flu)
Converts coordinates from FLU to FRD frame.
Eigen::Vector3f varianceEnuToNed(const Eigen::Vector3f &v_enu)
Converts variance from ENU to NED frame.
Eigen::Vector3f varianceNedToEnu(const Eigen::Vector3f &v_ned)
Converts variance from NED to ENU frame.
Eigen::Quaternionf attitudeFrdToFlu(const Eigen::Quaternionf &q_frd)
Converts attitude from FRD to FLU frame. Performs reference frame change and quaternion rotation s....
Eigen::Quaternionf attitudeFluToFrd(const Eigen::Quaternionf &q_flu)
Converts attitude from FLU to FRD frame. Performs reference frame change and quaternion rotation s....
Eigen::Quaternionf attitudeNedToEnu(const Eigen::Quaternionf &q_ned)
Converts attitude from NED to ENU frame. Performs reference frame change and quaternion rotation s....
Eigen::Vector3f positionNedToEnu(const Eigen::Vector3f &ned)
Converts coordinates from NED to ENU frame.
float yawNedToEnu(const float yaw_ned_rad)
Converts yaw from NED to ENU frame.
float yawEnuToNed(const float yaw_enu_rad)
Converts yaw from ENU to NED frame.
Eigen::Vector3f yawBodyToWorld(float yaw, const Eigen::Vector3f &point_body)
Transforms a point from body frame to world frame given the yaw of the body's attitude....
Eigen::Vector3f positionEnuToNed(const Eigen::Vector3f &enu)
Converts coordinates from ENU to NED frame.
float yawRateEnuToNed(const float yaw_rate_enu)
Converts yaw rate from ENU to NED frame.