From 84c3c0d234416062ee4c9087159cac28e3180f2a Mon Sep 17 00:00:00 2001 From: Jacob Walser Date: Mon, 20 Feb 2017 13:30:35 -0500 Subject: [PATCH] Sub: Add support for AP_AHRS_View --- ArduSub/Sub.cpp | 9 +++++---- ArduSub/Sub.h | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ArduSub/Sub.cpp b/ArduSub/Sub.cpp index e6f2d8da10..bc601c0232 100644 --- a/ArduSub/Sub.cpp +++ b/ArduSub/Sub.cpp @@ -61,15 +61,16 @@ Sub::Sub(void) : condition_start(0), G_Dt(MAIN_LOOP_SECONDS), inertial_nav(ahrs), - attitude_control(ahrs, aparm, motors, MAIN_LOOP_SECONDS), - pos_control(ahrs, inertial_nav, motors, attitude_control, + ahrs_view(ahrs, ROTATION_NONE), + attitude_control(ahrs_view, aparm, motors, MAIN_LOOP_SECONDS), + pos_control(ahrs_view, inertial_nav, motors, attitude_control, g.p_alt_hold, g.p_vel_z, g.pid_accel_z, g.p_pos_xy, g.pi_vel_xy), #if AVOIDANCE_ENABLED == ENABLED avoid(ahrs, inertial_nav, fence, g2.proximity), #endif - wp_nav(inertial_nav, ahrs, pos_control, attitude_control), - circle_nav(inertial_nav, ahrs, pos_control), + wp_nav(inertial_nav, ahrs_view, pos_control, attitude_control), + circle_nav(inertial_nav, ahrs_view, pos_control), pmTest1(0), fast_loopTimer(0), mainLoop_count(0), diff --git a/ArduSub/Sub.h b/ArduSub/Sub.h index ad002687df..edf3aadb4f 100644 --- a/ArduSub/Sub.h +++ b/ArduSub/Sub.h @@ -401,6 +401,8 @@ private: // Inertial Navigation AP_InertialNav_NavEKF inertial_nav; + AP_AHRS_View ahrs_view; + // Attitude, Position and Waypoint navigation objects // To-Do: move inertial nav up or other navigation variables down here AC_AttitudeControl_Sub attitude_control;