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