mixer_module: add support for test_motor (motor_test CLI command)

This commit is contained in:
Beat Küng
2019-10-21 09:42:08 +02:00
parent 349469cf75
commit 0871802568
9 changed files with 170 additions and 45 deletions
+8 -1
View File
@@ -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]);
}