Auterion App SDK
Auterion SDK is a library that can be used by AuterionOS apps to communicate with the system.
Loading...
Searching...
No Matches
local_frame_position_control.hpp
1/****************************************************************************
2 *
3 * Copyright 2026 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#include <auterion_sdk/control/surface_vehicle/position_setpoint_common.hpp>
37#include <cmath>
38#include <optional>
39
40namespace auterion {
41namespace surface_vehicle {
84 : public detail::PositionSetpointSpeedsBase<LocalFramePositionSetpoint> {
85 private:
86 Eigen::Vector2f _position_en_m{NAN, NAN};
87 std::optional<Eigen::Vector2f> _start_position_en_m{};
88
89 public:
95 class Config : public detail::PositionSetpointConfigBase<Config> {};
96
98
102 explicit LocalFramePositionSetpoint(const Eigen::Vector2f& position_en_m)
103 : _position_en_m(position_en_m) {}
104
108 LocalFramePositionSetpoint& withPosition(const Eigen::Vector2f& position_en_m) {
109 _position_en_m = position_en_m;
110 return *this;
111 }
112
117 LocalFramePositionSetpoint& withPosition(const Eigen::Vector3f& position_enu_m) {
118 _position_en_m = position_enu_m.head<2>();
119 return *this;
120 }
121
129 LocalFramePositionSetpoint& withStartPosition(const Eigen::Vector2f& start_position_en_m) {
130 _start_position_en_m = start_position_en_m;
131 return *this;
132 }
133
134 inline Eigen::Vector2f getPosition() const { return _position_en_m; }
135 inline std::optional<Eigen::Vector2f> getStartPosition() const { return _start_position_en_m; }
136};
137
139} // namespace surface_vehicle
140} // namespace auterion
Mode-wide defaults for LocalFramePositionSetpoint.
Definition local_frame_position_control.hpp:95
Drive to a 2D position in the local frame.
Definition local_frame_position_control.hpp:84
LocalFramePositionSetpoint(const Eigen::Vector2f &position_en_m)
Definition local_frame_position_control.hpp:102
LocalFramePositionSetpoint & withPosition(const Eigen::Vector3f &position_enu_m)
Sets the target position from a 3D local ENU position [m]. The height (z) is ignored,...
Definition local_frame_position_control.hpp:117
LocalFramePositionSetpoint & withPosition(const Eigen::Vector2f &position_en_m)
Sets the target position (East, North) in the local frame [m].
Definition local_frame_position_control.hpp:108
LocalFramePositionSetpoint & withStartPosition(const Eigen::Vector2f &start_position_en_m)
Sets the start of the line that the vehicle follows to the target (East, North) [m].
Definition local_frame_position_control.hpp:129
Mode-wide defaults shared by the surface vehicle position setpoint types.
Definition position_setpoint_common.hpp:48
Speed settings shared by the surface vehicle position setpoint types.
Definition position_setpoint_common.hpp:82