Use "POSCTL" switch name consistently

This commit is contained in:
Anton Babushkin 2014-05-11 12:54:15 +02:00
parent fc4c4c0bd1
commit 808badb34d
3 changed files with 17 additions and 17 deletions

View File

@ -599,7 +599,7 @@ PARAM_DEFINE_INT32(RC_MAP_MODE_SW, 0);
PARAM_DEFINE_INT32(RC_MAP_RETURN_SW, 0); PARAM_DEFINE_INT32(RC_MAP_RETURN_SW, 0);
/** /**
* Assist switch channel mapping. * Posctl switch channel mapping.
* *
* @min 0 * @min 0
* @max 18 * @max 18
@ -703,7 +703,7 @@ PARAM_DEFINE_FLOAT(RC_ASSIST_TH, 0.25f);
PARAM_DEFINE_FLOAT(RC_AUTO_TH, 0.75f); PARAM_DEFINE_FLOAT(RC_AUTO_TH, 0.75f);
/** /**
* Threshold for selecting posctrl mode * Threshold for selecting posctl mode
* *
* min:-1 * min:-1
* max:+1 * max:+1
@ -716,7 +716,7 @@ PARAM_DEFINE_FLOAT(RC_AUTO_TH, 0.75f);
* negative : true when channel<th * negative : true when channel<th
* *
*/ */
PARAM_DEFINE_FLOAT(RC_POSCTRL_TH, 0.5f); PARAM_DEFINE_FLOAT(RC_POSCTL_TH, 0.5f);
/** /**
* Threshold for selecting return to launch mode * Threshold for selecting return to launch mode

View File

@ -255,7 +255,7 @@ private:
int rc_map_mode_sw; int rc_map_mode_sw;
int rc_map_return_sw; int rc_map_return_sw;
int rc_map_posctrl_sw; int rc_map_posctl_sw;
int rc_map_loiter_sw; int rc_map_loiter_sw;
// int rc_map_offboard_ctrl_mode_sw; // int rc_map_offboard_ctrl_mode_sw;
@ -271,12 +271,12 @@ private:
int32_t rc_fails_thr; int32_t rc_fails_thr;
float rc_assist_th; float rc_assist_th;
float rc_auto_th; float rc_auto_th;
float rc_posctrl_th; float rc_posctl_th;
float rc_return_th; float rc_return_th;
float rc_loiter_th; float rc_loiter_th;
bool rc_assist_inv; bool rc_assist_inv;
bool rc_auto_inv; bool rc_auto_inv;
bool rc_posctrl_inv; bool rc_posctl_inv;
bool rc_return_inv; bool rc_return_inv;
bool rc_loiter_inv; bool rc_loiter_inv;
@ -309,7 +309,7 @@ private:
param_t rc_map_mode_sw; param_t rc_map_mode_sw;
param_t rc_map_return_sw; param_t rc_map_return_sw;
param_t rc_map_posctrl_sw; param_t rc_map_posctl_sw;
param_t rc_map_loiter_sw; param_t rc_map_loiter_sw;
// param_t rc_map_offboard_ctrl_mode_sw; // param_t rc_map_offboard_ctrl_mode_sw;
@ -325,7 +325,7 @@ private:
param_t rc_fails_thr; param_t rc_fails_thr;
param_t rc_assist_th; param_t rc_assist_th;
param_t rc_auto_th; param_t rc_auto_th;
param_t rc_posctrl_th; param_t rc_posctl_th;
param_t rc_return_th; param_t rc_return_th;
param_t rc_loiter_th; param_t rc_loiter_th;
@ -526,7 +526,7 @@ Sensors::Sensors() :
_parameter_handles.rc_map_flaps = param_find("RC_MAP_FLAPS"); _parameter_handles.rc_map_flaps = param_find("RC_MAP_FLAPS");
/* optional mode switches, not mapped per default */ /* optional mode switches, not mapped per default */
_parameter_handles.rc_map_posctrl_sw = param_find("RC_MAP_POSCTL_SW"); _parameter_handles.rc_map_posctl_sw = param_find("RC_MAP_POSCTL_SW");
_parameter_handles.rc_map_loiter_sw = param_find("RC_MAP_LOITER_SW"); _parameter_handles.rc_map_loiter_sw = param_find("RC_MAP_LOITER_SW");
// _parameter_handles.rc_map_offboard_ctrl_mode_sw = param_find("RC_MAP_OFFB_SW"); // _parameter_handles.rc_map_offboard_ctrl_mode_sw = param_find("RC_MAP_OFFB_SW");
@ -541,7 +541,7 @@ Sensors::Sensors() :
_parameter_handles.rc_fails_thr = param_find("RC_FAILS_THR"); _parameter_handles.rc_fails_thr = param_find("RC_FAILS_THR");
_parameter_handles.rc_assist_th = param_find("RC_ASSIST_TH"); _parameter_handles.rc_assist_th = param_find("RC_ASSIST_TH");
_parameter_handles.rc_auto_th = param_find("RC_AUTO_TH"); _parameter_handles.rc_auto_th = param_find("RC_AUTO_TH");
_parameter_handles.rc_posctrl_th = param_find("RC_POSCTRL_TH"); _parameter_handles.rc_posctl_th = param_find("RC_POSCTL_TH");
_parameter_handles.rc_return_th = param_find("RC_RETURN_TH"); _parameter_handles.rc_return_th = param_find("RC_RETURN_TH");
_parameter_handles.rc_loiter_th = param_find("RC_LOITER_TH"); _parameter_handles.rc_loiter_th = param_find("RC_LOITER_TH");
@ -678,7 +678,7 @@ Sensors::parameters_update()
warnx("%s", paramerr); warnx("%s", paramerr);
} }
if (param_get(_parameter_handles.rc_map_posctrl_sw, &(_parameters.rc_map_posctrl_sw)) != OK) { if (param_get(_parameter_handles.rc_map_posctl_sw, &(_parameters.rc_map_posctl_sw)) != OK) {
warnx("%s", paramerr); warnx("%s", paramerr);
} }
@ -706,9 +706,9 @@ Sensors::parameters_update()
param_get(_parameter_handles.rc_auto_th, &(_parameters.rc_auto_th)); param_get(_parameter_handles.rc_auto_th, &(_parameters.rc_auto_th));
_parameters.rc_auto_inv = (_parameters.rc_auto_th<0); _parameters.rc_auto_inv = (_parameters.rc_auto_th<0);
_parameters.rc_auto_th = fabs(_parameters.rc_auto_th); _parameters.rc_auto_th = fabs(_parameters.rc_auto_th);
param_get(_parameter_handles.rc_posctrl_th, &(_parameters.rc_posctrl_th)); param_get(_parameter_handles.rc_posctl_th, &(_parameters.rc_posctl_th));
_parameters.rc_posctrl_inv = (_parameters.rc_posctrl_th<0); _parameters.rc_posctl_inv = (_parameters.rc_posctl_th<0);
_parameters.rc_posctrl_th = fabs(_parameters.rc_posctrl_th); _parameters.rc_posctl_th = fabs(_parameters.rc_posctl_th);
param_get(_parameter_handles.rc_return_th, &(_parameters.rc_return_th)); param_get(_parameter_handles.rc_return_th, &(_parameters.rc_return_th));
_parameters.rc_return_inv = (_parameters.rc_return_th<0); _parameters.rc_return_inv = (_parameters.rc_return_th<0);
_parameters.rc_return_th = fabs(_parameters.rc_return_th); _parameters.rc_return_th = fabs(_parameters.rc_return_th);
@ -724,7 +724,7 @@ Sensors::parameters_update()
_rc.function[MODE] = _parameters.rc_map_mode_sw - 1; _rc.function[MODE] = _parameters.rc_map_mode_sw - 1;
_rc.function[RETURN] = _parameters.rc_map_return_sw - 1; _rc.function[RETURN] = _parameters.rc_map_return_sw - 1;
_rc.function[POSCTRL] = _parameters.rc_map_posctrl_sw - 1; _rc.function[POSCTL] = _parameters.rc_map_posctl_sw - 1;
_rc.function[LOITER] = _parameters.rc_map_loiter_sw - 1; _rc.function[LOITER] = _parameters.rc_map_loiter_sw - 1;
_rc.function[FLAPS] = _parameters.rc_map_flaps - 1; _rc.function[FLAPS] = _parameters.rc_map_flaps - 1;
@ -1478,7 +1478,7 @@ Sensors::rc_poll()
/* mode switches */ /* mode switches */
manual.mode_switch = get_rc_sw3pos_position(MODE, _parameters.rc_auto_th, _parameters.rc_auto_inv, _parameters.rc_assist_th, _parameters.rc_assist_inv); manual.mode_switch = get_rc_sw3pos_position(MODE, _parameters.rc_auto_th, _parameters.rc_auto_inv, _parameters.rc_assist_th, _parameters.rc_assist_inv);
manual.posctrl_switch = get_rc_sw2pos_position(POSCTRL, _parameters.rc_posctrl_th, _parameters.rc_posctrl_inv); manual.posctl_switch = get_rc_sw2pos_position(POSCTL, _parameters.rc_posctl_th, _parameters.rc_posctl_inv);
manual.return_switch = get_rc_sw2pos_position(RETURN, _parameters.rc_return_th, _parameters.rc_return_inv); manual.return_switch = get_rc_sw2pos_position(RETURN, _parameters.rc_return_th, _parameters.rc_return_inv);
manual.loiter_switch = get_rc_sw2pos_position(LOITER, _parameters.rc_loiter_th, _parameters.rc_loiter_inv); manual.loiter_switch = get_rc_sw2pos_position(LOITER, _parameters.rc_loiter_th, _parameters.rc_loiter_inv);

View File

@ -64,7 +64,7 @@ enum RC_CHANNELS_FUNCTION {
YAW = 3, YAW = 3,
MODE = 4, MODE = 4,
RETURN = 5, RETURN = 5,
POSCTRL = 6, POSCTL = 6,
LOITER = 7, LOITER = 7,
OFFBOARD_MODE = 8, OFFBOARD_MODE = 8,
FLAPS = 9, FLAPS = 9,