ardupilot/libraries/AP_DAL/AP_DAL_VisualOdom.h
Andrew Tridgell e116b1ff0a AP_DAL: added data access layer library
This provides a wrapper around sensor and system calls to allow for
logging for replay in EKF2 and EKF3

Co-authored-by: Peter Barker <pbarker@barker.dropbear.id.au>
2020-11-10 16:15:45 +11:00

52 lines
962 B
C++

#pragma once
#include <AP_Logger/LogStructure.h>
#include <AP_VisualOdom/AP_VisualOdom.h>
#include <AP_Vehicle/AP_Vehicle_Type.h>
class AP_DAL_VisualOdom {
public:
// return VisualOdom health
bool healthy() const {
return RVOH.healthy;
}
bool enabled() const {
return RVOH.enabled;
}
bool get_delay_ms() const {
return RVOH.delay_ms;
}
// return a 3D vector defining the position offset of the camera in meters relative to the body frame origin
const Vector3f &get_pos_offset() const {
return RVOH.pos_offset;
}
// AP_DAL methods:
AP_DAL_VisualOdom();
AP_DAL_VisualOdom *visualodom() {
if (RVOH.ptr_is_nullptr) {
return nullptr;
}
return this;
}
void start_frame();
#if APM_BUILD_TYPE(APM_BUILD_Replay)
void handle_message(const log_RVOH &msg) {
RVOH = msg;
}
#endif
private:
struct log_RVOH RVOH;
};