mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-26 22:56:41 +08:00
test chibios / build (CubeOrange-ODID, 10, chibios) (push) Waiting to run
test chibios / build (CubeOrange-PPP, 10, chibios) (push) Waiting to run
test chibios / build (CubeOrange-bootloader, 10, chibios) (push) Waiting to run
test chibios / build (CubeRed-EKF2, 10, chibios) (push) Waiting to run
test chibios / build (CubeRedPrimary-bootloader, 10, chibios) (push) Waiting to run
test chibios / build (MatekF405-Wing, 10, chibios) (push) Waiting to run
test chibios / build (Pixhawk6X-PPPGW, 10, chibios) (push) Waiting to run
test chibios / build (SOHW, 10, chibios) (push) Waiting to run
test chibios / build (build-options-defaults-test, 10, chibios) (push) Waiting to run
test chibios / build (configure-all, 10, chibios) (push) Waiting to run
test chibios / build (fmuv2-plane, 10, chibios) (push) Waiting to run
test chibios / build (fmuv3, 10, chibios) (push) Waiting to run
test chibios / build (fmuv3-bootloader, 10, chibios) (push) Waiting to run
test chibios / build (iofirmware, 10, chibios) (push) Waiting to run
test chibios / build (new-check, 10, chibios) (push) Waiting to run
test chibios / build (periph-build, 10, chibios) (push) Waiting to run
test chibios / build (revo-bootloader, 10, chibios) (push) Waiting to run
test chibios / build (revo-mini, 10, chibios) (push) Waiting to run
test chibios / build (signing, 10, chibios) (push) Waiting to run
test chibios / build (stm32f7, 10, chibios) (push) Waiting to run
test chibios / build (stm32h7, 10, chibios) (push) Waiting to run
test chibios / build (stm32h7-debug, 10, chibios) (push) Waiting to run
test scripts / build (astyle-cleanliness) (push) Waiting to run
test scripts / build (check_autotest_options) (push) Waiting to run
test scripts / build (logger_metadata) (push) Waiting to run
test scripts / build (param_parse) (push) Waiting to run
test scripts / build (python-cleanliness) (push) Waiting to run
test scripts / build (validate_board_list) (push) Waiting to run
test blimp / build (base) (push) Waiting to run
test blimp / build (clang) (push) Waiting to run
test blimp / autotest (sitltest-blimp) (push) Blocked by required conditions
test copter / build (base) (push) Waiting to run
test copter / build (clang) (push) Waiting to run
test copter / autotest (sitltest-copter-tests1a) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests1b) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests1c) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests1d) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests1e) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests2a) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests2b) (push) Blocked by required conditions
test copter / build-gcc-heli (push) Waiting to run
test copter / autotest-heli (sitltest-heli) (push) Blocked by required conditions
test ap_periph / build-gcc-ap_periph (push) Waiting to run
test ap_periph / autotest-can (sitltest-can) (push) Blocked by required conditions
test plane / build (base) (push) Waiting to run
test plane / build (clang) (push) Waiting to run
test plane / autotest (sitltest-plane-tests1a) (push) Blocked by required conditions
test plane / autotest (sitltest-plane-tests1b) (push) Blocked by required conditions
test plane / autotest (sitltest-quadplane) (push) Blocked by required conditions
test rover / build (base) (push) Waiting to run
test rover / build (clang) (push) Waiting to run
test rover / autotest (sitltest-balancebot) (push) Blocked by required conditions
test rover / autotest (sitltest-rover) (push) Blocked by required conditions
test rover / autotest (sitltest-sailboat) (push) Blocked by required conditions
test sub / build (base) (push) Waiting to run
test sub / build (clang) (push) Waiting to run
test sub / autotest (sitltest-sub) (push) Blocked by required conditions
test tracker / build (base) (push) Waiting to run
test tracker / build (clang) (push) Waiting to run
test tracker / autotest (sitltest-tracker) (push) Blocked by required conditions
test unit tests and sitl building / build (examples, base) (push) Waiting to run
test unit tests and sitl building / build (examples, clang) (push) Waiting to run
test unit tests and sitl building / build (sitl, base) (push) Waiting to run
test unit tests and sitl building / build (sitl, clang) (push) Waiting to run
test unit tests and sitl building / build (unit-tests, base) (push) Waiting to run
test unit tests and sitl building / build (unit-tests, clang) (push) Waiting to run
colcon build/test / build-test (push) Has been cancelled
Cygwin Build / build (push) Has been cancelled
ESP32 Build / build (esp32buzz, 10) (push) Has been cancelled
ESP32 Build / build (esp32s3empty, 10) (push) Has been cancelled
Macos Build / build (CubeOrange) (push) Has been cancelled
Macos Build / build (sitl) (push) Has been cancelled
QURT Build / build (push) Has been cancelled
test ccache / build (10, chibios) (push) Has been cancelled
test dds / build (sitl) (push) Has been cancelled
test dds / build (stm32h7) (push) Has been cancelled
test environment setup / build (bookworm, debian) (push) Has been cancelled
test environment setup / build (bullseye, debian) (push) Has been cancelled
test environment setup / build (focal, ubuntu) (push) Has been cancelled
test environment setup / build (jammy, ubuntu) (push) Has been cancelled
test environment setup / build (latest, archlinux) (push) Has been cancelled
test environment setup / build (noble, ubuntu) (push) Has been cancelled
test environment setup / build-alpine (push) Has been cancelled
test Linux SBC / build (bbbmini, armhf) (push) Has been cancelled
test Linux SBC / build (bebop, armhf) (push) Has been cancelled
test Linux SBC / build (bhat, armhf) (push) Has been cancelled
test Linux SBC / build (canzero, armhf) (push) Has been cancelled
test Linux SBC / build (erlebrain2, armhf) (push) Has been cancelled
test Linux SBC / build (linux, base) (push) Has been cancelled
test Linux SBC / build (navigator, armhf-musl) (push) Has been cancelled
test Linux SBC / build (navigator64, aarch64) (push) Has been cancelled
test Linux SBC / build (navio, armhf) (push) Has been cancelled
test Linux SBC / build (navio2, armhf) (push) Has been cancelled
test Linux SBC / build (pxf, armhf) (push) Has been cancelled
test Linux SBC / build (pxfmini, armhf) (push) Has been cancelled
test replay / build (replay, base) (push) Has been cancelled
test replay / build (replay, clang) (push) Has been cancelled
98 lines
2.8 KiB
C++
98 lines
2.8 KiB
C++
/*
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
//
|
|
// ExternalAHRS GPS driver
|
|
//
|
|
#include <AP_ExternalAHRS/AP_ExternalAHRS.h>
|
|
#include "AP_GPS_ExternalAHRS.h"
|
|
|
|
#if HAL_EXTERNAL_AHRS_ENABLED
|
|
|
|
// Reading does nothing in this class; we simply return whether or not
|
|
// the latest reading has been consumed. By calling this function we assume
|
|
// the caller is consuming the new data;
|
|
bool AP_GPS_ExternalAHRS::read(void)
|
|
{
|
|
if (new_data) {
|
|
new_data = false;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// handles an incoming ExternalAHRS message and sets
|
|
// corresponding gps data appropriately;
|
|
void AP_GPS_ExternalAHRS::handle_external(const AP_ExternalAHRS::gps_data_message_t &pkt)
|
|
{
|
|
check_new_itow(pkt.ms_tow, sizeof(pkt));
|
|
|
|
state.time_week = pkt.gps_week;
|
|
state.time_week_ms = pkt.ms_tow;
|
|
if (pkt.fix_type == AP_GPS_FixType::NO_GPS) {
|
|
state.status = AP_GPS::NO_FIX;
|
|
} else {
|
|
state.status = (AP_GPS::GPS_Status)pkt.fix_type;
|
|
}
|
|
state.num_sats = pkt.satellites_in_view;
|
|
|
|
Location loc = {};
|
|
loc.lat = pkt.latitude;
|
|
loc.lng = pkt.longitude;
|
|
loc.alt = pkt.msl_altitude;
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
|
if (!loc.initialised() && state.status >= AP_GPS::GPS_Status::GPS_OK_FIX_2D) {
|
|
AP_HAL::panic("Invalid location passed to AP_GPS_ExternalAHRS");
|
|
}
|
|
#endif
|
|
|
|
state.location = loc;
|
|
state.hdop = pkt.hdop;
|
|
state.vdop = pkt.vdop;
|
|
|
|
state.have_vertical_velocity = true;
|
|
state.velocity.x = pkt.ned_vel_north;
|
|
state.velocity.y = pkt.ned_vel_east;
|
|
state.velocity.z = pkt.ned_vel_down;
|
|
|
|
velocity_to_speed_course(state);
|
|
|
|
state.have_speed_accuracy = true;
|
|
state.have_horizontal_accuracy = true;
|
|
state.have_vertical_accuracy = true;
|
|
state.have_vertical_velocity = true;
|
|
|
|
state.horizontal_accuracy = pkt.horizontal_pos_accuracy;
|
|
state.vertical_accuracy = pkt.vertical_pos_accuracy;
|
|
state.speed_accuracy = pkt.horizontal_vel_accuracy;
|
|
|
|
state.last_gps_time_ms = AP_HAL::millis();
|
|
|
|
new_data = true;
|
|
}
|
|
|
|
/*
|
|
return velocity lag in seconds
|
|
*/
|
|
bool AP_GPS_ExternalAHRS::get_lag(float &lag_sec) const
|
|
{
|
|
// fixed assumed lag
|
|
lag_sec = 0.11;
|
|
return true;
|
|
}
|
|
|
|
#endif // HAL_EXTERNAL_AHRS_ENABLED
|
|
|