mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 08:43:34 +08:00
MISSION switch renamed to LOITER
This commit is contained in:
@@ -1231,12 +1231,12 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* MISSION switch */
|
/* MISSION switch */
|
||||||
if (sp_man.mission_switch == SWITCH_POS_ON) {
|
if (sp_man.loiter_switch == SWITCH_POS_ON) {
|
||||||
/* stick is in LOITER position */
|
/* stick is in LOITER position */
|
||||||
status.set_nav_state = NAV_STATE_LOITER;
|
status.set_nav_state = NAV_STATE_LOITER;
|
||||||
status.set_nav_state_timestamp = hrt_absolute_time();
|
status.set_nav_state_timestamp = hrt_absolute_time();
|
||||||
|
|
||||||
} else if (sp_man.mission_switch != SWITCH_POS_NONE) {
|
} else if (sp_man.loiter_switch != SWITCH_POS_NONE) {
|
||||||
/* stick is in MISSION position */
|
/* stick is in MISSION position */
|
||||||
status.set_nav_state = NAV_STATE_MISSION;
|
status.set_nav_state = NAV_STATE_MISSION;
|
||||||
status.set_nav_state_timestamp = hrt_absolute_time();
|
status.set_nav_state_timestamp = hrt_absolute_time();
|
||||||
|
|||||||
@@ -594,13 +594,13 @@ PARAM_DEFINE_INT32(RC_MAP_RETURN_SW, 0);
|
|||||||
PARAM_DEFINE_INT32(RC_MAP_ASSIST_SW, 0);
|
PARAM_DEFINE_INT32(RC_MAP_ASSIST_SW, 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mission switch channel mapping.
|
* Loiter switch channel mapping.
|
||||||
*
|
*
|
||||||
* @min 0
|
* @min 0
|
||||||
* @max 18
|
* @max 18
|
||||||
* @group Radio Calibration
|
* @group Radio Calibration
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_INT32(RC_MAP_MISSIO_SW, 0);
|
PARAM_DEFINE_INT32(RC_MAP_LOITER_SW, 0);
|
||||||
|
|
||||||
//PARAM_DEFINE_INT32(RC_MAP_OFFB_SW, 0);
|
//PARAM_DEFINE_INT32(RC_MAP_OFFB_SW, 0);
|
||||||
|
|
||||||
|
|||||||
@@ -254,7 +254,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_assisted_sw;
|
int rc_map_assisted_sw;
|
||||||
int rc_map_mission_sw;
|
int rc_map_loiter_sw;
|
||||||
|
|
||||||
// int rc_map_offboard_ctrl_mode_sw;
|
// int rc_map_offboard_ctrl_mode_sw;
|
||||||
|
|
||||||
@@ -297,7 +297,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_assisted_sw;
|
param_t rc_map_assisted_sw;
|
||||||
param_t rc_map_mission_sw;
|
param_t rc_map_loiter_sw;
|
||||||
|
|
||||||
// param_t rc_map_offboard_ctrl_mode_sw;
|
// param_t rc_map_offboard_ctrl_mode_sw;
|
||||||
|
|
||||||
@@ -508,7 +508,7 @@ Sensors::Sensors() :
|
|||||||
|
|
||||||
/* optional mode switches, not mapped per default */
|
/* optional mode switches, not mapped per default */
|
||||||
_parameter_handles.rc_map_assisted_sw = param_find("RC_MAP_ASSIST_SW");
|
_parameter_handles.rc_map_assisted_sw = param_find("RC_MAP_ASSIST_SW");
|
||||||
_parameter_handles.rc_map_mission_sw = param_find("RC_MAP_MISSIO_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");
|
||||||
|
|
||||||
@@ -654,7 +654,7 @@ Sensors::parameters_update()
|
|||||||
warnx(paramerr);
|
warnx(paramerr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (param_get(_parameter_handles.rc_map_mission_sw, &(_parameters.rc_map_mission_sw)) != OK) {
|
if (param_get(_parameter_handles.rc_map_loiter_sw, &(_parameters.rc_map_loiter_sw)) != OK) {
|
||||||
warnx(paramerr);
|
warnx(paramerr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -682,7 +682,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[ASSISTED] = _parameters.rc_map_assisted_sw - 1;
|
_rc.function[ASSISTED] = _parameters.rc_map_assisted_sw - 1;
|
||||||
_rc.function[MISSION] = _parameters.rc_map_mission_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;
|
||||||
|
|
||||||
@@ -1416,7 +1416,7 @@ Sensors::rc_poll()
|
|||||||
/* mode switches */
|
/* mode switches */
|
||||||
manual.mode_switch = get_rc_switch_position(MODE);
|
manual.mode_switch = get_rc_switch_position(MODE);
|
||||||
manual.assisted_switch = get_rc_switch_position(ASSISTED);
|
manual.assisted_switch = get_rc_switch_position(ASSISTED);
|
||||||
manual.mission_switch = get_rc_switch_position(MISSION);
|
manual.loiter_switch = get_rc_switch_position(LOITER);
|
||||||
manual.return_switch = get_rc_switch_position(RETURN);
|
manual.return_switch = get_rc_switch_position(RETURN);
|
||||||
|
|
||||||
/* publish manual_control_setpoint topic */
|
/* publish manual_control_setpoint topic */
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ struct manual_control_setpoint_s {
|
|||||||
switch_pos_t mode_switch; /**< mode 3 position switch (mandatory): manual, assisted, auto */
|
switch_pos_t mode_switch; /**< mode 3 position switch (mandatory): manual, assisted, auto */
|
||||||
switch_pos_t return_switch; /**< land 2 position switch (mandatory): land, no effect */
|
switch_pos_t return_switch; /**< land 2 position switch (mandatory): land, no effect */
|
||||||
switch_pos_t assisted_switch; /**< assisted 2 position switch (optional): seatbelt, simple */
|
switch_pos_t assisted_switch; /**< assisted 2 position switch (optional): seatbelt, simple */
|
||||||
switch_pos_t mission_switch; /**< mission 2 position switch (optional): mission, loiter */
|
switch_pos_t loiter_switch; /**< mission 2 position switch (optional): mission, loiter */
|
||||||
}; /**< manual control inputs */
|
}; /**< manual control inputs */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ enum RC_CHANNELS_FUNCTION {
|
|||||||
MODE = 4,
|
MODE = 4,
|
||||||
RETURN = 5,
|
RETURN = 5,
|
||||||
ASSISTED = 6,
|
ASSISTED = 6,
|
||||||
MISSION = 7,
|
LOITER = 7,
|
||||||
OFFBOARD_MODE = 8,
|
OFFBOARD_MODE = 8,
|
||||||
FLAPS = 9,
|
FLAPS = 9,
|
||||||
AUX_1 = 10,
|
AUX_1 = 10,
|
||||||
|
|||||||
Reference in New Issue
Block a user