commander: add COM_MOT_TEST_EN parameter to enable/disable motor testing

This commit is contained in:
Beat Küng
2019-10-22 10:49:59 +02:00
parent 02833c6075
commit b5ba1665f6
3 changed files with 16 additions and 0 deletions
+4
View File
@@ -1144,6 +1144,10 @@ Commander::handle_command_motor_test(const vehicle_command_s &cmd)
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.timestamp = hrt_absolute_time();
test_motor.motor_number = (int)(cmd.param1 + 0.5f) - 1;