AutoAPMS
Resilient Robot Mission Management
Loading...
Searching...
No Matches
enable_hold.cpp
1// Copyright 2024 Robin Müller
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#include "auto_apms_interfaces/action/enable_hold.hpp"
16
17#include "auto_apms_px4/mode_executor.hpp"
18
19namespace auto_apms_px4
20{
21
22class EnableHoldSkill : public ModeExecutor<auto_apms_interfaces::action::EnableHold>
23{
24public:
25 explicit EnableHoldSkill(const rclcpp::NodeOptions & options)
26 : ModeExecutor{_AUTO_APMS_PX4__ENABLE_HOLD_ACTION_NAME, options, FlightMode::Hold, false}
27 {
28 }
29
30private:
31 bool isCompleted(std::shared_ptr<const Goal> goal_ptr, const px4_msgs::msg::VehicleStatus & vehicle_status) final
32 {
33 (void)goal_ptr;
34 (void)vehicle_status;
35 // For HOLD mode there is no completion signal. Once activated it is considered complete.
36 return true;
37 }
38};
39
40} // namespace auto_apms_px4
41
42#include "rclcpp_components/register_node_macro.hpp"
43RCLCPP_COMPONENTS_REGISTER_NODE(auto_apms_px4::EnableHoldSkill)
Generic template class for executing a PX4 mode implementing the interface of a standard ROS 2 action...
Implementation of PX4 mode peers offered by px4_ros2_cpp enabling integration with AutoAPMS.
Definition mode.hpp:26