Browse Source

AP_DAL: fixed build without VisualOdometry

zr-v5.1
Andrew Tridgell 4 years ago
parent
commit
50d03571da
  1. 2
      libraries/AP_DAL/AP_DAL.cpp
  2. 6
      libraries/AP_DAL/AP_DAL.h
  3. 4
      libraries/AP_DAL/AP_DAL_VisualOdom.cpp
  4. 4
      libraries/AP_DAL/AP_DAL_VisualOdom.h

2
libraries/AP_DAL/AP_DAL.cpp

@ -74,7 +74,9 @@ void AP_DAL::start_frame(AP_DAL::FrameType frametype) @@ -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;

6
libraries/AP_DAL/AP_DAL.h

@ -139,9 +139,11 @@ public: @@ -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: @@ -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: @@ -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;

4
libraries/AP_DAL/AP_DAL_VisualOdom.cpp

@ -2,6 +2,8 @@ @@ -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() @@ -21,3 +23,5 @@ void AP_DAL_VisualOdom::start_frame()
WRITE_REPLAY_BLOCK_IFCHANGD(RVOH, RVOH, old);
}
#endif // HAL_VISUALODOM_ENABLED

4
libraries/AP_DAL/AP_DAL_VisualOdom.h

@ -6,6 +6,8 @@ @@ -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: @@ -49,3 +51,5 @@ private:
struct log_RVOH RVOH;
};
#endif // HAL_VISUALODOM_ENABLED

Loading…
Cancel
Save