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
12namespace px4_ros2 {
26 public:
27 explicit HomePositionSetter(Context& context);
28
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
Definition context.hpp:18
Utility to set the vehicle's home position and GPS global origin.
Definition home_position_setter.hpp:25
Result setGpsGlobalOrigin(double latitude, double longitude, float altitude)
Set the GPS global origin (EKF reference point).
Result setHomeToCurrentPosition()
Set the home position to the current vehicle position.
Result setHome(double latitude, double longitude, float altitude)
Set the home position to a specific global coordinate.
Sends a VehicleCommand and waits synchronously for an ACK from PX4.
Definition vehicle_command_sender.hpp:27
Result
Definition mode.hpp:29