PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
Loading...
Searching...
No Matches
requirement_flags.hpp
1/****************************************************************************
2 * Copyright (c) 2023 PX4 Development Team.
3 * SPDX-License-Identifier: BSD-3-Clause
4 ****************************************************************************/
5
6#pragma once
7
8#include <px4_msgs/msg/arming_check_reply.hpp>
9
10namespace px4_ros2
11{
12
17{
18 void fillArmingCheckReply(px4_msgs::msg::ArmingCheckReply & arming_check_reply)
19 {
20 arming_check_reply.mode_req_angular_velocity = angular_velocity;
21 arming_check_reply.mode_req_attitude = attitude;
22 arming_check_reply.mode_req_local_alt = local_alt;
23 arming_check_reply.mode_req_local_position = local_position;
24 arming_check_reply.mode_req_local_position_relaxed = local_position_relaxed;
25 arming_check_reply.mode_req_global_position = global_position;
26 arming_check_reply.mode_req_mission = mission;
27 arming_check_reply.mode_req_home_position = home_position;
28 arming_check_reply.mode_req_prevent_arming = prevent_arming;
29 arming_check_reply.mode_req_manual_control = manual_control;
30 }
31
32 void clearAll()
33 {
34 *this = RequirementFlags{};
35 }
36
37 RequirementFlags & operator|=(const RequirementFlags & other)
38 {
39 angular_velocity |= other.angular_velocity;
40 attitude |= other.attitude;
41 local_alt |= other.local_alt;
42 local_position |= other.local_position;
43 local_position_relaxed |= other.local_position_relaxed;
44 global_position |= other.global_position;
45 mission |= other.mission;
46 home_position |= other.home_position;
48 manual_control |= other.manual_control;
49 return *this;
50 }
51
52 bool angular_velocity{false};
53 bool attitude{false};
54 bool local_alt{false};
55 bool local_position{false};
56 bool local_position_relaxed{false};
57 bool global_position{false};
58 bool mission{false};
59 bool home_position{false};
60 bool prevent_arming{false};
61 bool manual_control{false};
62};
63
64} // namespace px4_ros2
Requirement flags used by modes.
Definition requirement_flags.hpp:17
bool prevent_arming
If set, arming is prevented when the mode is selected.
Definition requirement_flags.hpp:60