APM:Libraries
|
#include <inttypes.h>
#include <AP_Common/AP_Common.h>
#include <AP_HAL/AP_HAL.h>
#include "vector2.h"
#include "vector3.h"
Go to the source code of this file.
Macros | |
#define | LOCATION_SCALING_FACTOR 0.011131884502145034f |
#define | LOCATION_SCALING_FACTOR_INV 89.83204953368922f |
Functions | |
float | longitude_scale (const struct Location &loc) |
float | get_distance (const struct Location &loc1, const struct Location &loc2) |
uint32_t | get_distance_cm (const struct Location &loc1, const struct Location &loc2) |
float | get_horizontal_distance_cm (const Vector3f &origin, const Vector3f &destination) |
int32_t | get_bearing_cd (const struct Location &loc1, const struct Location &loc2) |
float | get_bearing_cd (const Vector3f &origin, const Vector3f &destination) |
bool | location_passed_point (const struct Location &location, const struct Location &point1, const struct Location &point2) |
float | location_path_proportion (const struct Location &location, const struct Location &point1, const struct Location &point2) |
void | location_update (struct Location &loc, float bearing, float distance) |
void | location_offset (struct Location &loc, float ofs_north, float ofs_east) |
Vector2f | location_diff (const struct Location &loc1, const struct Location &loc2) |
Vector3f | location_3d_diff_NED (const struct Location &loc1, const struct Location &loc2) |
bool | locations_are_same (const struct Location &loc1, const struct Location &loc2) |
bool | location_sanitize (const struct Location &defaultLoc, struct Location &loc) |
void | print_latlon (AP_HAL::BetterStream *s, int32_t lat_or_lon) |
void | wgsllh2ecef (const Vector3d &llh, Vector3d &ecef) |
void | wgsecef2llh (const Vector3d &ecef, Vector3d &llh) |
bool | check_lat (float lat) |
bool | check_lng (float lng) |
bool | check_lat (int32_t lat) |
bool | check_lng (int32_t lng) |
bool | check_latlng (float lat, float lng) |
bool | check_latlng (int32_t lat, int32_t lng) |
bool | check_latlng (Location loc) |
#define LOCATION_SCALING_FACTOR 0.011131884502145034f |
Definition at line 13 of file location.h.
Referenced by get_distance(), Location_Class::get_distance(), location_3d_diff_NED(), and location_diff().
#define LOCATION_SCALING_FACTOR_INV 89.83204953368922f |
Definition at line 15 of file location.h.
Referenced by location_offset(), and Location_Class::offset().
bool check_lat | ( | float | lat | ) |
Definition at line 215 of file location.cpp.
Referenced by check_latlng(), AP_Mission::mavlink_int_to_mission_cmd(), and AP_Mission::mavlink_to_mission_cmd().
bool check_lat | ( | int32_t | lat | ) |
Definition at line 223 of file location.cpp.
bool check_latlng | ( | float | lat, |
float | lng | ||
) |
Definition at line 231 of file location.cpp.
Referenced by AC_Fence::handle_msg(), GCS_MAVLINK::handle_rally_point(), GCS_MAVLINK::handle_set_gps_global_origin(), location_sanitize(), and GCS_MAVLINK::set_ekf_origin().
bool check_latlng | ( | int32_t | lat, |
int32_t | lng | ||
) |
bool check_latlng | ( | Location | loc | ) |
bool check_lng | ( | float | lng | ) |
Definition at line 219 of file location.cpp.
Referenced by check_latlng(), AP_Mission::mavlink_int_to_mission_cmd(), and AP_Mission::mavlink_to_mission_cmd().
bool check_lng | ( | int32_t | lng | ) |
Definition at line 227 of file location.cpp.
Definition at line 56 of file location.cpp.
Referenced by AC_WPNav::advance_wp_target_along_track(), AP_Frsky_Telem::calc_home(), AC_PosControl::get_bearing_to_target(), AP_Mission::get_next_ground_course_cd(), AC_WPNav::get_wp_bearing_to_destination(), test_one_offset(), AP_Landing::type_slope_setup_landing_glide_slope(), AP_Landing::type_slope_verify_abort_landing(), AP_Landing::type_slope_verify_land(), AP_L1_Control::update_loiter(), AP_L1_Control::update_waypoint(), and AP_Landing_Deepstall::verify_abort_landing().
Definition at line 66 of file location.cpp.
Definition at line 36 of file location.cpp.
Referenced by AP_Frsky_Telem::calc_home(), AP_Rally::find_nearest_rally_point(), get_distance_cm(), AP_Mission::get_landing_sequence_start(), SITL::XPlane::receive_data(), SITL::ADSB::send_report(), test_accuracy(), test_one_offset(), AP_Landing::type_slope_adjust_landing_slope_for_rangefinder_bump(), AP_Landing::type_slope_setup_landing_glide_slope(), AP_Landing::type_slope_verify_land(), AP_Camera::update(), AP_Avoidance::update_threat_level(), and AP_Landing_Deepstall::verify_land().
Definition at line 44 of file location.cpp.
Referenced by AC_Fence::check_destination_within_fence().
Definition at line 149 of file location.cpp.
Referenced by AP_GPS::all_consistent(), AP_AHRS_NavEKF::get_relative_position_NED_home(), and AP_Follow::get_target_dist_and_vel_ned().
Definition at line 139 of file location.cpp.
Referenced by AP_GPS::calc_blended_state(), NavEKF2_core::calcGpsGoodToAlign(), NavEKF3_core::calcGpsGoodToAlign(), closest_approach_xy(), AP_AHRS_NavEKF::get_relative_position_NE_home(), AP_AHRS_NavEKF::get_relative_position_NE_origin(), AP_AHRS_NavEKF::get_relative_position_NED_origin(), AP_Avoidance::get_vector_perpendicular(), SoaringController::get_wind_corrected_drift(), NavEKF2_core::getPosNE(), NavEKF3_core::getPosNE(), AP_Arming::gps_checks(), AC_Fence::load_polygon_from_eeprom(), location_path_proportion(), AP_Avoidance::perpendicular_xy(), AP_Avoidance::perpendicular_xyz(), NavEKF2_core::readGpsData(), NavEKF3_core::readGpsData(), SITL::CRRCSim::recv_fdm(), AP_Beacon_SITL::update(), AP_L1_Control::update_loiter(), AP_Landing_Deepstall::update_steering(), AP_L1_Control::update_waypoint(), and AP_Landing_Deepstall::verify_breakout().
void location_offset | ( | struct Location & | loc, |
float | ofs_north, | ||
float | ofs_east | ||
) |
Definition at line 125 of file location.cpp.
Referenced by AP_GPS::calc_blended_state(), AP_AHRS_DCM::get_position(), SoaringController::get_target(), AP_Follow::get_target_location_and_velocity(), NavEKF2_core::getLLH(), NavEKF3_core::getLLH(), location_update(), SITL::ADSB::send_report(), SITL::Aircraft::smooth_sensors(), test_one_offset(), AP_Beacon_SITL::update(), and SITL::Aircraft::update_position().
bool location_passed_point | ( | const struct Location & | location, |
const struct Location & | point1, | ||
const struct Location & | point2 | ||
) |
Definition at line 80 of file location.cpp.
Referenced by test_passed_waypoint(), and AP_Landing_Deepstall::verify_land().
float location_path_proportion | ( | const struct Location & | location, |
const struct Location & | point1, | ||
const struct Location & | point2 | ||
) |
Definition at line 94 of file location.cpp.
Referenced by location_passed_point(), and AP_Landing::type_slope_setup_landing_glide_slope().
void location_update | ( | struct Location & | loc, |
float | bearing, | ||
float | distance | ||
) |
Definition at line 115 of file location.cpp.
Referenced by AP_Landing_Deepstall::build_approach_path(), AP_Proximity_SITL::get_distance_to_fence(), AP_AHRS_DCM::get_position(), AP_Landing::type_slope_setup_landing_glide_slope(), AP_Landing::type_slope_verify_land(), and AP_Landing_Deepstall::verify_land().
Definition at line 159 of file location.cpp.
float longitude_scale | ( | const struct Location & | loc | ) |
Definition at line 27 of file location.cpp.
Referenced by get_bearing_cd(), get_distance(), Location_Class::get_distance(), Location_Class::get_vector_xy_from_origin_NE(), location_3d_diff_NED(), location_diff(), location_offset(), and Location_Class::offset().
void print_latlon | ( | AP_HAL::BetterStream * | s, |
int32_t | lat_or_lon | ||
) |
Definition at line 196 of file location.cpp.
Referenced by loop().
Definition at line 42 of file location_double.cpp.
Referenced by test_wgs_conversion_functions().
Definition at line 32 of file location_double.cpp.
Referenced by test_wgs_conversion_functions().