PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
Loading...
Searching...
No Matches
action.hpp
1/****************************************************************************
2 * Copyright (c) 2024 PX4 Development Team.
3 * SPDX-License-Identifier: BSD-3-Clause
4 ****************************************************************************/
5
6#pragma once
7#include <functional>
8#include <memory>
9#include <px4_ros2/mission/mission.hpp>
10#include <string>
11#include <vector>
12
13namespace px4_ros2 {
18class ActionHandler;
19
25 public:
26 virtual ~ActionInterface() = default;
27
28 virtual std::string name() const = 0;
29
30 virtual bool canRun(const ActionArguments& arguments, std::vector<std::string>& errors)
31 {
32 return true;
33 }
34
38 virtual bool shouldStopAtWaypoint(const ActionArguments& arguments) { return true; }
39
46 virtual bool supportsResumeFromLanded() { return false; }
47
48 virtual void run(const std::shared_ptr<ActionHandler>& handler, const ActionArguments& arguments,
49 const std::function<void()>& on_completed) = 0;
50
55 virtual void deactivate() {}
56};
57
59} /* namespace px4_ros2 */
Arguments passed to an action from the mission JSON definition.
Definition mission.hpp:25
Interface class for an action.
Definition action.hpp:24
virtual bool shouldStopAtWaypoint(const ActionArguments &arguments)
Definition action.hpp:38
virtual void deactivate()
Definition action.hpp:55
virtual bool supportsResumeFromLanded()
Definition action.hpp:46