PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
land_detected.hpp
1
/****************************************************************************
2
* Copyright (c) 2023-2024 PX4 Development Team.
3
* SPDX-License-Identifier: BSD-3-Clause
4
****************************************************************************/
5
6
#pragma once
7
8
#include <px4_msgs/msg/vehicle_land_detected.hpp>
9
#include <px4_ros2/common/context.hpp>
10
#include <px4_ros2/utils/message_version.hpp>
11
#include <px4_ros2/utils/subscription.hpp>
12
13
namespace
px4_ros2 {
23
class
LandDetected
:
public
Subscription
<px4_msgs::msg::VehicleLandDetected> {
24
public
:
25
explicit
LandDetected
(
Context
& context)
26
:
Subscription<px4_msgs::msg::VehicleLandDetected>
(
27
context,
"fmu/out/vehicle_land_detected"
+
28
px4_ros2::getMessageNameVersion<px4_msgs::msg::VehicleLandDetected>())
29
{
30
}
31
37
bool
landed
()
const
{
return
last
().landed; }
38
};
39
41
}
/* namespace px4_ros2 */
px4_ros2::Context
Definition:
context.hpp:18
px4_ros2::LandDetected
Provides access to the vehicle's status.
Definition:
land_detected.hpp:23
px4_ros2::LandDetected::landed
bool landed() const
Check if vehicle is landed on the ground.
Definition:
land_detected.hpp:37
px4_ros2::Subscription
Provides a subscription to arbitrary ROS topics.
Definition:
subscription.hpp:27
px4_ros2::Subscription< px4_msgs::msg::VehicleLandDetected >::last
const px4_msgs::msg::VehicleLandDetected & last() const
Get the last-received message.
Definition:
subscription.hpp:57
px4_ros2_cpp
include
px4_ros2
vehicle_state
land_detected.hpp
Generated by
1.9.1