PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
Loading...
Searching...
No Matches
thrust_rate.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_rate_setpoint.hpp>
9
#include <px4_msgs/msg/surface_vehicle_thrust_setpoint.hpp>
10
#include <px4_ros2/common/setpoint_base.hpp>
11
12
namespace
px4_ros2 {
22
class
SurfaceVehicleThrustRateSetpointType
:
public
SetpointBase
{
23
public
:
24
explicit
SurfaceVehicleThrustRateSetpointType
(
Context
& context);
25
26
~SurfaceVehicleThrustRateSetpointType
()
override
=
default
;
27
28
SetpointType
getSetpointType
()
override
29
{
30
return
px4_msgs::msg::SetpointConfig::TYPE_SURFACE_VEHICLE_THRUST_RATE;
31
}
32
33
float
desiredUpdateRateHz()
override
{
return
30.f; }
34
45
void
update
(
float
thrust_body_x,
float
yaw_rate_setpoint,
46
std::optional<float> thrust_body_y = {});
47
48
private
:
49
rclcpp::Node& _node;
50
rclcpp::Publisher<px4_msgs::msg::SurfaceVehicleThrustSetpoint>::SharedPtr
51
_surface_vehicle_thrust_setpoint_pub;
52
rclcpp::Publisher<px4_msgs::msg::SurfaceVehicleRateSetpoint>::SharedPtr
53
_surface_vehicle_rate_setpoint_pub;
54
};
55
57
}
/* namespace px4_ros2 */
px4_ros2::Context
Definition
context.hpp:18
px4_ros2::SetpointBase
Definition
setpoint_base.hpp:20
px4_ros2::SurfaceVehicleThrustRateSetpointType
Setpoint type for surface vehicle thrust and rate control.
Definition
thrust_rate.hpp:22
px4_ros2::SurfaceVehicleThrustRateSetpointType::update
void update(float thrust_body_x, float yaw_rate_setpoint, std::optional< float > thrust_body_y={})
Send a thrust setpoint and a rate setpoint to the flight controller.
px4_ros2::SurfaceVehicleThrustRateSetpointType::getSetpointType
SetpointType getSetpointType() override
Definition
thrust_rate.hpp:28
px4_ros2_cpp
include
px4_ros2
control
setpoint_types
experimental
surface_vehicle
thrust_rate.hpp
Generated by
1.9.8