Skip to content

Commit

Permalink
cleanup3
Browse files Browse the repository at this point in the history
  • Loading branch information
Astik-2002 committed Feb 18, 2024
1 parent 9193b50 commit f6900c0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 162 deletions.
12 changes: 2 additions & 10 deletions libraries/AC_CustomControl/AC_CustomControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
#include "AC_CustomControl_Backend.h"
// #include "AC_CustomControl_Empty.h"
#include "AC_CustomControl_PID.h"
#include "AC_CustomControl_LQR.h"
#include <GCS_MAVLink/GCS.h>

// table of user settable parameters
const AP_Param::GroupInfo AC_CustomControl::var_info[] = {
// @Param: _TYPE
// @DisplayName: Custom control type
// @Description: Custom control type to be used
// @Values: 0:None, 1:Empty, 2:PID, 3:LQR-integral
// @Values: 0:None, 1:Empty, 2:PID
// @RebootRequired: True
// @User: Advanced
AP_GROUPINFO_FLAGS("_TYPE", 1, AC_CustomControl, _controller_type, 0, AP_PARAM_FLAG_ENABLE),
Expand All @@ -34,9 +33,6 @@ const AP_Param::GroupInfo AC_CustomControl::var_info[] = {
// parameters for PID controller
AP_SUBGROUPVARPTR(_backend, "2_", 7, AC_CustomControl, _backend_var_info[1]),

// parameters for LQR controller
AP_SUBGROUPVARPTR(_backend, "3_", 8, AC_CustomControl, _backend_var_info[2]),

AP_GROUPEND
};

Expand Down Expand Up @@ -66,10 +62,6 @@ void AC_CustomControl::init(void)
_backend = new AC_CustomControl_PID(*this, _ahrs, _att_control, _motors, _dt);
_backend_var_info[get_type()] = AC_CustomControl_PID::var_info;
break;
case CustomControlType::CONT_LQR:
_backend = new AC_CustomControl_LQR(*this, _ahrs, _att_control, _motors, _dt);
_backend_var_info[get_type()] = AC_CustomControl_LQR::var_info;
break;
default:
return;
}
Expand Down Expand Up @@ -201,4 +193,4 @@ void AC_CustomControl::set_notch_sample_rate(float sample_rate)
#endif
}

#endif
#endif
5 changes: 2 additions & 3 deletions libraries/AC_CustomControl/AC_CustomControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#if AP_CUSTOMCONTROL_ENABLED

#ifndef CUSTOMCONTROL_MAX_TYPES
#define CUSTOMCONTROL_MAX_TYPES 3
#define CUSTOMCONTROL_MAX_TYPES 2
#endif

class AC_CustomControl_Backend;
Expand Down Expand Up @@ -48,7 +48,6 @@ class AC_CustomControl {
CONT_NONE = 0,
CONT_EMPTY = 1,
CONT_PID = 2,
CONT_LQR = 3,
}; // controller that should be used

enum class CustomControlOption {
Expand All @@ -73,4 +72,4 @@ class AC_CustomControl {
AC_CustomControl_Backend *_backend;
};

#endif
#endif
2 changes: 1 addition & 1 deletion libraries/AC_CustomControl/AC_CustomControl_Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ class AC_CustomControl_Backend
AC_CustomControl& _frontend;
};

#endif
#endif
114 changes: 0 additions & 114 deletions libraries/AC_CustomControl/AC_CustomControl_LQR.cpp

This file was deleted.

34 changes: 0 additions & 34 deletions libraries/AC_CustomControl/AC_CustomControl_LQR.h

This file was deleted.

0 comments on commit f6900c0

Please sign in to comment.