PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
Loading...
Searching...
No Matches
home_position_setter.hpp
1
/****************************************************************************
2
* Copyright (c) 2025 PX4 Development Team.
3
* SPDX-License-Identifier: BSD-3-Clause
4
****************************************************************************/
5
6
#pragma once
7
8
#include <px4_ros2/common/context.hpp>
9
#include <px4_ros2/components/mode.hpp>
10
#include <px4_ros2/utils/vehicle_command_sender.hpp>
11
12
namespace
px4_ros2 {
25
class
HomePositionSetter
{
26
public
:
27
explicit
HomePositionSetter
(
Context
& context);
28
33
Result
setHomeToCurrentPosition
();
34
43
Result
setHome
(
double
latitude,
double
longitude,
float
altitude);
44
53
Result
setGpsGlobalOrigin
(
double
latitude,
double
longitude,
float
altitude);
54
55
private
:
56
Result
sendCommand(uint32_t command,
float
param1 = 0.f,
float
param2 = 0.f,
float
param3 = 0.f,
57
float
param4 = 0.f,
double
param5 = 0.0,
double
param6 = 0.0,
58
float
param7 = 0.f);
59
60
VehicleCommandSender
_command_sender;
61
};
62
64
}
// namespace px4_ros2
px4_ros2::Context
Definition
context.hpp:18
px4_ros2::HomePositionSetter
Utility to set the vehicle's home position and GPS global origin.
Definition
home_position_setter.hpp:25
px4_ros2::HomePositionSetter::setGpsGlobalOrigin
Result setGpsGlobalOrigin(double latitude, double longitude, float altitude)
Set the GPS global origin (EKF reference point).
px4_ros2::HomePositionSetter::setHomeToCurrentPosition
Result setHomeToCurrentPosition()
Set the home position to the current vehicle position.
px4_ros2::HomePositionSetter::setHome
Result setHome(double latitude, double longitude, float altitude)
Set the home position to a specific global coordinate.
px4_ros2::VehicleCommandSender
Sends a VehicleCommand and waits synchronously for an ACK from PX4.
Definition
vehicle_command_sender.hpp:27
px4_ros2::Result
Result
Definition
mode.hpp:29
px4_ros2_cpp
include
px4_ros2
vehicle_state
home_position_setter.hpp
Generated by
1.9.8