PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
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 
10 namespace px4_ros2 {
11 
16  void fillArmingCheckReply(px4_msgs::msg::ArmingCheckReply& arming_check_reply)
17  {
18  arming_check_reply.mode_req_angular_velocity = angular_velocity;
19  arming_check_reply.mode_req_attitude = attitude;
20  arming_check_reply.mode_req_local_alt = local_alt;
21  arming_check_reply.mode_req_local_position = local_position;
22  arming_check_reply.mode_req_local_position_relaxed = local_position_relaxed;
23  arming_check_reply.mode_req_global_position = global_position;
24  arming_check_reply.mode_req_mission = mission;
25  arming_check_reply.mode_req_home_position = home_position;
26  arming_check_reply.mode_req_prevent_arming = prevent_arming;
27  arming_check_reply.mode_req_manual_control = manual_control;
28  }
29 
30  void clearAll() { *this = RequirementFlags{}; }
31 
32  RequirementFlags& operator|=(const RequirementFlags& other)
33  {
34  angular_velocity |= other.angular_velocity;
35  attitude |= other.attitude;
36  local_alt |= other.local_alt;
37  local_position |= other.local_position;
38  local_position_relaxed |= other.local_position_relaxed;
39  global_position |= other.global_position;
40  mission |= other.mission;
41  home_position |= other.home_position;
43  manual_control |= other.manual_control;
44  return *this;
45  }
46 
47  bool angular_velocity{false};
48  bool attitude{false};
49  bool local_alt{false};
50  bool local_position{false};
51  bool local_position_relaxed{false};
52  bool global_position{false};
53  bool mission{false};
54  bool home_position{false};
55  bool prevent_arming{false};
56  bool manual_control{false};
57 };
58 
59 } // namespace px4_ros2
Requirement flags used by modes.
Definition: requirement_flags.hpp:15
bool prevent_arming
If set, arming is prevented when the mode is selected.
Definition: requirement_flags.hpp:55