PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
Loading...
Searching...
No Matches
px4_ros2::HomePositionSetter Class Reference

Utility to set the vehicle's home position and GPS global origin. More...

#include <px4_ros2/vehicle_state/home_position_setter.hpp>

Public Member Functions

 HomePositionSetter (Context &context)
 
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.
 
Result setGpsGlobalOrigin (double latitude, double longitude, float altitude)
 Set the GPS global origin (EKF reference point).
 

Detailed Description

Utility to set the vehicle's home position and GPS global origin.

Sends VEHICLE_CMD_DO_SET_HOME and VEHICLE_CMD_SET_GPS_GLOBAL_ORIGIN commands to PX4 via the vehicle_command topic and waits for an ACK.

Member Function Documentation

◆ setGpsGlobalOrigin()

Result px4_ros2::HomePositionSetter::setGpsGlobalOrigin ( double  latitude,
double  longitude,
float  altitude 
)

Set the GPS global origin (EKF reference point).

Parameters
latitude[deg]
longitude[deg]
altitude[m AMSL]
Returns
Result::Success on ACK accepted, error otherwise.

◆ setHome()

Result px4_ros2::HomePositionSetter::setHome ( double  latitude,
double  longitude,
float  altitude 
)

Set the home position to a specific global coordinate.

Parameters
latitude[deg]
longitude[deg]
altitude[m AMSL]
Returns
Result::Success on ACK accepted, error otherwise.

◆ setHomeToCurrentPosition()

Result px4_ros2::HomePositionSetter::setHomeToCurrentPosition ( )

Set the home position to the current vehicle position.

Returns
Result::Success on ACK accepted, error otherwise.

The documentation for this class was generated from the following file: