Skip to content

Commit ed6a802

Browse files
committed
adding INDI custom controller
1 parent 15f6f94 commit ed6a802

File tree

5 files changed

+497
-5
lines changed

5 files changed

+497
-5
lines changed

libraries/AC_CustomControl/AC_CustomControl.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "AC_CustomControl_Backend.h"
88
// #include "AC_CustomControl_Empty.h"
99
#include "AC_CustomControl_PID.h"
10+
#include "AC_CustomControl_INDI.h"
1011
#include <GCS_MAVLink/GCS.h>
1112
#include <AP_Logger/AP_Logger.h>
1213

@@ -33,6 +34,9 @@ const AP_Param::GroupInfo AC_CustomControl::var_info[] = {
3334
// parameters for PID controller
3435
AP_SUBGROUPVARPTR(_backend, "2_", 7, AC_CustomControl, _backend_var_info[1]),
3536

37+
// parameters for INDI controller
38+
AP_SUBGROUPVARPTR(_backend, "3_", 8, AC_CustomControl, _backend_var_info[2]),
39+
3640
AP_GROUPEND
3741
};
3842

@@ -62,6 +66,10 @@ void AC_CustomControl::init(void)
6266
_backend = new AC_CustomControl_PID(*this, _ahrs, _att_control, _motors, _dt);
6367
_backend_var_info[get_type()] = AC_CustomControl_PID::var_info;
6468
break;
69+
case CustomControlType::CONT_INDI:
70+
_backend = new AC_CustomControl_INDI(*this, _ahrs, _att_control, _motors, _dt);
71+
_backend_var_info[get_type()] = AC_CustomControl_INDI::var_info;
72+
break;
6573
default:
6674
return;
6775
}

libraries/AC_CustomControl/AC_CustomControl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <AP_Motors/AP_MotorsMulticopter.h>
1515

1616
#ifndef CUSTOMCONTROL_MAX_TYPES
17-
#define CUSTOMCONTROL_MAX_TYPES 2
17+
#define CUSTOMCONTROL_MAX_TYPES 3
1818
#endif
1919

2020
class AC_CustomControl_Backend;
@@ -49,6 +49,7 @@ class AC_CustomControl {
4949
CONT_NONE = 0,
5050
CONT_EMPTY = 1,
5151
CONT_PID = 2,
52+
CONT_INDI = 3,
5253
}; // controller that should be used
5354

5455
enum class CustomControlOption {

0 commit comments

Comments
 (0)