PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
px4_ros2::MapProjection Class Reference

Provides methods to convert between the geographical coordinate system ("global") and the local azimuthal equidistant plane ("local"). More...

#include <px4_ros2/utils/geodesic.hpp>

Public Member Functions

 MapProjection (Context &context)
 
bool isInitialized () const
 
Eigen::Vector2f globalToLocal (const Eigen::Vector2d &global_position) const
 Transform a point in the geographic coordinate system to the local azimuthal equidistant plane using the projection. More...
 
Eigen::Vector3f globalToLocal (const Eigen::Vector3d &global_position) const
 Transform a point in the geographic coordinate system to the local azimuthal equidistant plane using the projection. More...
 
Eigen::Vector2d localToGlobal (const Eigen::Vector2f &local_position) const
 Transform a point in the local azimuthal equidistant plane to the geographic coordinate system using the projection. More...
 
Eigen::Vector3d localToGlobal (const Eigen::Vector3f &local_position) const
 Transform a point in the local azimuthal equidistant plane to the geographic coordinate system using the projection. More...
 

Detailed Description

Provides methods to convert between the geographical coordinate system ("global") and the local azimuthal equidistant plane ("local").

This class handles ROS2 subscription and initializing the map projection reference point from PX4. The mathematical implementation is contained in px4_ros2::MapProjectionImpl.

See also
px4_ros2::MapProjectionImpl

Member Function Documentation

◆ globalToLocal() [1/2]

Eigen::Vector2f px4_ros2::MapProjection::globalToLocal ( const Eigen::Vector2d &  global_position) const

Transform a point in the geographic coordinate system to the local azimuthal equidistant plane using the projection.

Parameters
global_positionlat [deg], lon [deg]
Returns
the point in local coordinates as north, east [m]

◆ globalToLocal() [2/2]

Eigen::Vector3f px4_ros2::MapProjection::globalToLocal ( const Eigen::Vector3d &  global_position) const

Transform a point in the geographic coordinate system to the local azimuthal equidistant plane using the projection.

Parameters
global_positionlat [deg], lon [deg], alt AMSL [m]
Returns
the point in local coordinates as north, east, down [m]

◆ isInitialized()

bool px4_ros2::MapProjection::isInitialized ( ) const
Returns
true, if the map reference has been initialized before

◆ localToGlobal() [1/2]

Eigen::Vector2d px4_ros2::MapProjection::localToGlobal ( const Eigen::Vector2f &  local_position) const

Transform a point in the local azimuthal equidistant plane to the geographic coordinate system using the projection.

Parameters
local_positionnorth, east [m]
Returns
the point in geographic coordinates as lat [deg], lon [deg]

◆ localToGlobal() [2/2]

Eigen::Vector3d px4_ros2::MapProjection::localToGlobal ( const Eigen::Vector3f &  local_position) const

Transform a point in the local azimuthal equidistant plane to the geographic coordinate system using the projection.

Parameters
local_positionnorth, east, down [m]
Returns
the point in geographic coordinates as lat [deg], lon [deg], alt AMSL [m]

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