AP_DAL: fixed build without VisualOdometry

This commit is contained in:
Andrew Tridgell 2020-11-06 21:21:46 +11:00
parent b7d60b1d97
commit 50d03571da
4 changed files with 16 additions and 0 deletions

View File

@ -74,7 +74,9 @@ void AP_DAL::start_frame(AP_DAL::FrameType frametype)
_airspeed.start_frame();
_rangefinder.start_frame();
_beacon.start_frame();
#if HAL_VISUALODOM_ENABLED
_visualodom.start_frame();
#endif
// populate some derivative values:
_micros = _RFRH.time_us;

View File

@ -139,9 +139,11 @@ public:
AP_DAL_Beacon *beacon() {
return _beacon.beacon();
}
#if HAL_VISUALODOM_ENABLED
AP_DAL_VisualOdom *visualodom() {
return _visualodom.visualodom();
}
#endif
// this method *always* returns you the compass. This is in
// constrast to get_compass, which only returns the compass once
@ -260,7 +262,9 @@ public:
_beacon.handle_message(msg);
}
void handle_message(const log_RVOH &msg) {
#if HAL_VISUALODOM_ENABLED
_visualodom.handle_message(msg);
#endif
}
#endif
@ -295,7 +299,9 @@ private:
AP_DAL_Compass _compass;
AP_DAL_Airspeed _airspeed;
AP_DAL_Beacon _beacon;
#if HAL_VISUALODOM_ENABLED
AP_DAL_VisualOdom _visualodom;
#endif
static bool logging_started;
static bool force_write;

View File

@ -2,6 +2,8 @@
#include <AP_VisualOdom/AP_VisualOdom.h>
#if HAL_VISUALODOM_ENABLED
#include <AP_Logger/AP_Logger.h>
#include "AP_DAL.h"
@ -21,3 +23,5 @@ void AP_DAL_VisualOdom::start_frame()
WRITE_REPLAY_BLOCK_IFCHANGD(RVOH, RVOH, old);
}
#endif // HAL_VISUALODOM_ENABLED

View File

@ -6,6 +6,8 @@
#include <AP_Vehicle/AP_Vehicle_Type.h>
#if HAL_VISUALODOM_ENABLED
class AP_DAL_VisualOdom {
public:
@ -49,3 +51,5 @@ private:
struct log_RVOH RVOH;
};
#endif // HAL_VISUALODOM_ENABLED