Skip to content

Commit

Permalink
Renamed "controller any" to "auto select"
Browse files Browse the repository at this point in the history
  • Loading branch information
krichardsson committed Feb 1, 2023
1 parent bc58d44 commit 0cc31a9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion configs/bolt_defconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_PLATFORM_BOLT=y

CONFIG_ESTIMATOR_ANY=y
CONFIG_CONTROLLER_ANY=y
CONFIG_CONTROLLER_AUTO_SELECT=y
2 changes: 1 addition & 1 deletion configs/cfbl_defconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_MOTORS_ESC_PROTOCOL_DSHOT=y

CONFIG_ESTIMATOR_ANY=y
CONFIG_CONTROLLER_ANY=y
CONFIG_CONTROLLER_AUTO_SELECT=y
2 changes: 1 addition & 1 deletion configs/tag_defconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CONFIG_PLATFORM_TAG=y

CONFIG_ESTIMATOR_ANY=y
CONFIG_CONTROLLER_ANY=y
CONFIG_CONTROLLER_AUTO_SELECT=y

CONFIG_DECK_FORCE="bcLoco"
CONFIG_SENSORS_IGNORE_BAROMETER_FAIL=y
4 changes: 2 additions & 2 deletions docs/development/create_platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ To make it easier for people to build for `RINCEWIND` we can add a `defconfig` f
CONFIG_PLATFORM_BOLT=y

CONFIG_ESTIMATOR_ANY=y
CONFIG_CONTROLLER_ANY=y
CONFIG_CONTROLLER_AUTO_SELECT=y
```

Based on this a start of `rincewind_defconfig` could be:
Expand All @@ -205,7 +205,7 @@ Based on this a start of `rincewind_defconfig` could be:
CONFIG_PLATFORM_RINCEWIND=y

CONFIG_ESTIMATOR_ANY=y
CONFIG_CONTROLLER_ANY=y
CONFIG_CONTROLLER_AUTO_SELECT=y
```

Then `RINCEWIND` platform could be built by:
Expand Down
2 changes: 1 addition & 1 deletion src/modules/interface/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "stabilizer_types.h"

typedef enum {
ControllerTypeAny,
ControllerTypeAutoSelect,
ControllerTypePID,
ControllerTypeMellinger,
ControllerTypeINDI,
Expand Down
6 changes: 3 additions & 3 deletions src/modules/src/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ menu "Controllers and Estimators"

choice
prompt "Default controller"
default CONFIG_CONTROLLER_ANY
default CONFIG_CONTROLLER_AUTO_SELECT

config CONTROLLER_ANY
bool "Any Controller"
config CONTROLLER_AUTO_SELECT
bool "Auto select Controller"
help
Do not care which controller is used, if any

Expand Down
8 changes: 4 additions & 4 deletions src/modules/src/controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "autoconf.h"

#define DEFAULT_CONTROLLER ControllerTypePID
static ControllerType currentController = ControllerTypeAny;
static ControllerType currentController = ControllerTypeAutoSelect;

static void initController();

Expand Down Expand Up @@ -41,7 +41,7 @@ void controllerInit(ControllerType controller) {

currentController = controller;

if (ControllerTypeAny == currentController) {
if (ControllerTypeAutoSelect == currentController) {
currentController = DEFAULT_CONTROLLER;
}

Expand All @@ -54,11 +54,11 @@ void controllerInit(ControllerType controller) {
#elif defined(CONFIG_CONTROLLER_BRESCIANINI)
#define CONTROLLER ControllerTypeBrescianini
#else
#define CONTROLLER ControllerTypeAny
#define CONTROLLER ControllerTypeAutoSelect
#endif

ControllerType forcedController = CONTROLLER;
if (forcedController != ControllerTypeAny) {
if (forcedController != ControllerTypeAutoSelect) {
DEBUG_PRINT("Controller type forced\n");
currentController = forcedController;
}
Expand Down
6 changes: 3 additions & 3 deletions src/modules/src/stabilizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void stabilizerInit(StateEstimatorType estimator)

sensorsInit();
stateEstimatorInit(estimator);
controllerInit(ControllerTypeAny);
controllerInit(ControllerTypeAutoSelect);
powerDistributionInit();
motorsInit(platformConfigGetMotorMapping());
collisionAvoidanceInit();
Expand Down Expand Up @@ -360,12 +360,12 @@ void stabilizerSetEmergencyStopTimeout(int timeout)
PARAM_GROUP_START(stabilizer)
/**
* @brief Estimator type Any(0), complementary(1), extended kalman(2), **unscented kalman(3) (Default: 0)
*
*
* ** Experimental, needs to be enabled in kbuild
*/
PARAM_ADD_CORE(PARAM_UINT8, estimator, &estimatorType)
/**
* @brief Controller type Any(0), PID(1), Mellinger(2), INDI(3), Brescianini(4) (Default: 0)
* @brief Controller type Auto select(0), PID(1), Mellinger(2), INDI(3), Brescianini(4) (Default: 0)
*/
PARAM_ADD_CORE(PARAM_UINT8, controller, &controllerType)
/**
Expand Down

0 comments on commit 0cc31a9

Please sign in to comment.