Path: blob/master/libraries/AP_DAL/AP_DAL_VisualOdom.cpp
9386 views
#include "AP_DAL_VisualOdom.h"12#include <AP_VisualOdom/AP_VisualOdom.h>34#if HAL_VISUALODOM_ENABLED56#include <AP_Logger/AP_Logger.h>7#include "AP_DAL.h"8#include <AP_Vehicle/AP_Vehicle_Type.h>910/*11update position offsets to align to AHRS position12should only be called when this library is not being used as the position source13This function does not change EKF state, so does not need to be logged14*/15void AP_DAL_VisualOdom::align_position_to_ahrs(bool align_xy, bool align_z)16{17#if !APM_BUILD_TYPE(APM_BUILD_AP_DAL_Standalone)18auto *vo = AP::visualodom();19vo->align_position_to_ahrs(align_xy, align_z);20#endif21}2223void AP_DAL_VisualOdom::start_frame()24{25const auto *vo = AP::visualodom();2627const log_RVOH old = RVOH;28if (vo != nullptr) {29RVOH.pos_offset = vo->get_pos_offset();30RVOH.delay_ms = vo->get_delay_ms();31RVOH.healthy = vo->healthy();32RVOH.enabled = vo->enabled();33}3435WRITE_REPLAY_BLOCK_IFCHANGED(RVOH, RVOH, old);36}3738#endif // HAL_VISUALODOM_ENABLED394041