PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
trajectory_executor.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 
11 namespace px4_ros2
12 {
22 {
23 public:
24  TrajectoryExecutorInterface() = default;
26  virtual ~TrajectoryExecutorInterface() = default;
27 
28  virtual bool navigationItemTypeSupported(NavigationItemType type) = 0;
29  virtual bool frameSupported(MissionFrame mission_frame) = 0;
30 
32  {
33  std::shared_ptr<Mission> trajectory;
34  TrajectoryOptions options;
35  int start_index{0};
36  int end_index{0};
37  bool stop_at_last{true};
38  std::function<void(int)> on_index_reached;
39  std::function<void()> on_failure;
40  };
41  virtual void runTrajectory(const TrajectoryConfig & config) = 0;
42 
43  virtual void updateSetpoint() = 0;
44 };
45 
46 
48 } /* namespace px4_ros2 */
Interface for a trajectory executor.
Definition: trajectory_executor.hpp:22
Definition: trajectory_executor.hpp:32
Definition: mission.hpp:121