PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
Loading...
Searching...
No Matches
course.hpp
1/****************************************************************************
2 * Copyright (c) 2026 PX4 Development Team.
3 * SPDX-License-Identifier: BSD-3-Clause
4 ****************************************************************************/
5
6#pragma once
7
8#include <px4_msgs/msg/surface_vehicle_course_setpoint.hpp>
9#include <px4_ros2/common/setpoint_base.hpp>
10
11namespace px4_ros2 {
24 public:
26
27 ~SurfaceVehicleCourseSetpointType() override = default;
28
29 SetpointType getSetpointType() override
30 {
31 // The course setpoint is handled by the surface vehicle position controller
32 return px4_msgs::msg::SetpointConfig::TYPE_SURFACE_VEHICLE_POSITION;
33 }
34
35 float desiredUpdateRateHz() override { return 30.f; }
36
46 void update(float course, std::optional<float> speed = {}, std::optional<float> yaw = {});
47
48 private:
49 rclcpp::Node& _node;
50 rclcpp::Publisher<px4_msgs::msg::SurfaceVehicleCourseSetpoint>::SharedPtr
51 _surface_vehicle_course_setpoint_pub;
52};
53
55} /* namespace px4_ros2 */
Definition context.hpp:18
Definition setpoint_base.hpp:20
Setpoint type for surface vehicle course control.
Definition course.hpp:23
void update(float course, std::optional< float > speed={}, std::optional< float > yaw={})
Send a course setpoint to the flight controller.
SetpointType getSetpointType() override
Definition course.hpp:29