Skip to content

Commit

Permalink
ArduPlane: Plane: add test bits for AOA_SSA
Browse files Browse the repository at this point in the history
Some changes.
  • Loading branch information
colejmero authored and peterbarker committed May 18, 2023
1 parent a73ef13 commit a0af225
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ArduPlane/ArduPlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const AP_Scheduler::Task Plane::scheduler_tasks[] = {
SCHED_TASK(update_compass, 10, 200, 39),
SCHED_TASK(calc_airspeed_errors, 10, 100, 42),
SCHED_TASK(update_alt, 10, 200, 45),
SCHED_TASK_CLASS(AP_AngleSensor_AS5600, &plane.aoa_sensor, update, 10, 200, 46),
SCHED_TASK(adjust_altitude_target, 10, 200, 48),
#if AP_ADVANCEDFAILSAFE_ENABLED
SCHED_TASK(afs_fs_check, 10, 100, 51),
Expand Down Expand Up @@ -226,6 +227,7 @@ void Plane::update_compass(void)
compass.read();
}


/*
do 10Hz logging
*/
Expand Down
5 changes: 5 additions & 0 deletions ArduPlane/Plane.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#include <AP_OSD/AP_OSD.h>

#include <AP_Rally/AP_Rally.h>
#include <AP_AngleSensor/AS5600.h> //Magnetic Encoder library, line added by Cole

#include <AP_OpticalFlow/AP_OpticalFlow.h> // Optical Flow library
#include <AP_Parachute/AP_Parachute.h>
Expand All @@ -89,6 +90,8 @@
#include "quadplane.h"
#include "tuning.h"



// Configuration
#include "config.h"

Expand Down Expand Up @@ -198,6 +201,8 @@ class Plane : public AP_Vehicle {
AP_RPM rpm_sensor;
#endif

AP_AngleSensor_AS5600 aoa_sensor{2, 0x36}; //This is code added by Cole

AP_TECS TECS_controller{ahrs, aparm, landing, MASK_LOG_TECS};
AP_L1_Control L1_controller{ahrs, &TECS_controller};

Expand Down
3 changes: 3 additions & 0 deletions ArduPlane/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ void Plane::init_ardupilot()
#if AP_GRIPPER_ENABLED
g2.gripper.init();
#endif

//Code added by Cole, initialize AS5600 sensor
aoa_sensor.init();
}

//********************************************************************************
Expand Down
1 change: 1 addition & 0 deletions ArduPlane/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def build(bld):
'AP_Devo_Telem',
'AP_OSD',
'AC_AutoTune',
'AP_AngleSensor',
'AP_Follow',
],
)
Expand Down

0 comments on commit a0af225

Please sign in to comment.