mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 07:28:54 +08:00
To separate accuracy requirements for VTOL hover and cruise. - global_position_relaxed refers to having a valid horizontal velocity aid source in the estimator and a set global reference position, but poses no requirements on the accuracy of the provided position estimate. - Auto flight modes Mission, Loiter and RTL, while in fixed-wing mode, only require the relaxed global position going forward - COM_POS_FS_EPH is thus no longer used on fixed-wing vehicles (resp. VTOL in FW) - rename failsafe_flags.local_position_accuracy_low to failsafe_flags.position_accuracy_low --------- Signed-off-by: RomanBapst <bapstroman@gmail.com> Signed-off-by: Silvan Fuhrer <silvan@auterion.com> Co-authored-by: Silvan <silvan@auterion.com>
39 lines
1.4 KiB
C++
39 lines
1.4 KiB
C++
/****************************************************************************
|
|
* Copyright (c) 2025 PX4 Development Team.
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
****************************************************************************/
|
|
#pragma once
|
|
|
|
// Translate Event v0 <--> v1
|
|
#include <px4_msgs_old/msg/event_v0.hpp>
|
|
#include <px4_msgs/msg/event.hpp>
|
|
|
|
class EventV1Translation {
|
|
public:
|
|
using MessageOlder = px4_msgs_old::msg::EventV0;
|
|
static_assert(MessageOlder::MESSAGE_VERSION == 0);
|
|
|
|
using MessageNewer = px4_msgs::msg::Event;
|
|
static_assert(MessageNewer::MESSAGE_VERSION == 1);
|
|
|
|
static constexpr const char* kTopic = "fmu/out/event";
|
|
|
|
static void fromOlder(const MessageOlder &msg_older, MessageNewer &msg_newer) {
|
|
msg_newer.timestamp = msg_older.timestamp;
|
|
msg_newer.id = msg_older.id;
|
|
msg_newer.event_sequence = msg_older.event_sequence;
|
|
msg_newer.arguments = msg_older.arguments;
|
|
msg_newer.log_levels = msg_older.log_levels;
|
|
}
|
|
|
|
static void toOlder(const MessageNewer &msg_newer, MessageOlder &msg_older) {
|
|
msg_older.timestamp = msg_newer.timestamp;
|
|
msg_older.id = msg_newer.id;
|
|
msg_older.event_sequence = msg_newer.event_sequence;
|
|
msg_older.arguments = msg_newer.arguments;
|
|
msg_older.log_levels = msg_newer.log_levels;
|
|
}
|
|
};
|
|
|
|
REGISTER_TOPIC_TRANSLATION_DIRECT(EventV1Translation);
|