PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
Loading...
Searching...
No Matches
thrust_steering.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/surface_vehicle_steering_setpoint.hpp>
9#include <px4_msgs/msg/surface_vehicle_thrust_setpoint.hpp>
10#include <px4_ros2/common/setpoint_base.hpp>
11
12namespace px4_ros2 {
23 public:
25
27
28 SetpointType getSetpointType() override
29 {
30 return px4_msgs::msg::SetpointConfig::TYPE_SURFACE_VEHICLE_THRUST_STEERING;
31 }
32
33 float desiredUpdateRateHz() override { return 30.f; }
34
47 void update(float thrust_body_x, float normalized_steering_setpoint,
48 std::optional<float> thrust_body_y = {});
49
50 private:
51 rclcpp::Node& _node;
52 rclcpp::Publisher<px4_msgs::msg::SurfaceVehicleThrustSetpoint>::SharedPtr
53 _surface_vehicle_thrust_setpoint_pub;
54 rclcpp::Publisher<px4_msgs::msg::SurfaceVehicleSteeringSetpoint>::SharedPtr
55 _surface_vehicle_steering_setpoint_pub;
56};
57
59} /* namespace px4_ros2 */
Definition context.hpp:18
Definition setpoint_base.hpp:20
Setpoint type for surface vehicle thrust and steering control.
Definition thrust_steering.hpp:22
void update(float thrust_body_x, float normalized_steering_setpoint, std::optional< float > thrust_body_y={})
Send a thrust setpoint and a steering setpoint to the flight controller.
SetpointType getSetpointType() override
Definition thrust_steering.hpp:28