mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 02:21:35 +08:00
mixer_module: add support for test_motor (motor_test CLI command)
This commit is contained in:
@@ -496,7 +496,14 @@ void TAP_ESC::cycle()
|
||||
if (test_motor_updated) {
|
||||
struct test_motor_s test_motor;
|
||||
orb_copy(ORB_ID(test_motor), _test_motor_sub, &test_motor);
|
||||
_outputs.output[test_motor.motor_number] = RPMSTOPPED + ((RPMMAX - RPMSTOPPED) * test_motor.value);
|
||||
|
||||
if (test_motor.action == test_motor_s::ACTION_STOP) {
|
||||
_outputs.output[test_motor.motor_number] = RPMSTOPPED;
|
||||
|
||||
} else {
|
||||
_outputs.output[test_motor.motor_number] = RPMSTOPPED + ((RPMMAX - RPMSTOPPED) * test_motor.value);
|
||||
}
|
||||
|
||||
PX4_INFO("setting motor %i to %.1lf", test_motor.motor_number,
|
||||
(double)_outputs.output[test_motor.motor_number]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user