mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 02:36:37 +08:00
commander: add COM_MOT_TEST_EN parameter to enable/disable motor testing
This commit is contained in:
@@ -1144,6 +1144,10 @@ Commander::handle_command_motor_test(const vehicle_command_s &cmd)
|
|||||||
return vehicle_command_s::VEHICLE_CMD_RESULT_DENIED;
|
return vehicle_command_s::VEHICLE_CMD_RESULT_DENIED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_param_com_mot_test_en.get() != 1) {
|
||||||
|
return vehicle_command_s::VEHICLE_CMD_RESULT_DENIED;
|
||||||
|
}
|
||||||
|
|
||||||
test_motor_s test_motor{};
|
test_motor_s test_motor{};
|
||||||
test_motor.timestamp = hrt_absolute_time();
|
test_motor.timestamp = hrt_absolute_time();
|
||||||
test_motor.motor_number = (int)(cmd.param1 + 0.5f) - 1;
|
test_motor.motor_number = (int)(cmd.param1 + 0.5f) - 1;
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ private:
|
|||||||
(ParamInt<px4::params::COM_OBL_RC_ACT>) _param_com_obl_rc_act,
|
(ParamInt<px4::params::COM_OBL_RC_ACT>) _param_com_obl_rc_act,
|
||||||
|
|
||||||
(ParamInt<px4::params::COM_PREARM_MODE>) _param_com_prearm_mode,
|
(ParamInt<px4::params::COM_PREARM_MODE>) _param_com_prearm_mode,
|
||||||
|
(ParamInt<px4::params::COM_MOT_TEST_EN>) _param_com_mot_test_en,
|
||||||
|
|
||||||
(ParamInt<px4::params::CBRK_SUPPLY_CHK>) _param_cbrk_supply_chk,
|
(ParamInt<px4::params::CBRK_SUPPLY_CHK>) _param_cbrk_supply_chk,
|
||||||
(ParamInt<px4::params::CBRK_USB_CHK>) _param_cbrk_usb_chk,
|
(ParamInt<px4::params::CBRK_USB_CHK>) _param_cbrk_usb_chk,
|
||||||
|
|||||||
@@ -967,3 +967,14 @@ PARAM_DEFINE_INT32(COM_ARM_CHK_ESCS, 1);
|
|||||||
* @group Commander
|
* @group Commander
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_INT32(COM_PREARM_MODE, 1);
|
PARAM_DEFINE_INT32(COM_PREARM_MODE, 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable Motor Testing
|
||||||
|
*
|
||||||
|
* If set, enables the motor test interface via MAVLink (DO_MOTOR_TEST), that
|
||||||
|
* allows spinning the motors for testing purposes.
|
||||||
|
*
|
||||||
|
* @boolean
|
||||||
|
* @group Commander
|
||||||
|
*/
|
||||||
|
PARAM_DEFINE_INT32(COM_MOT_TEST_EN, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user