MotorTest client
To test motors, request the IMotorTestClient microservice from a device instance.
var motorTestClient = device.GetMicroservice<IMotorTestClient>()
?? throw new Exception("No motor test client found");
Usage
Retrieve the list of testable motors from the connected device and read their telemetry:
// Access telemetry for each test motor
foreach (var motor in motorTestClient.TestMotors)
{
Console.WriteLine($"ID: {motor.Id}, Servo channel: {motor.ServoChannel}, PWM: {motor.Pwm}, Test running: {motor.IsTestRun}");
}
To run a test, first select a motor:
var testMotor = motorTestClient.TestMotors.First();
// Start a 10-second test of the selected motor at 50% power
var result = await testMotor.StartTest(50, 10);
if (result == MavResult.MavResultAccepted)
{
Console.WriteLine($"Test for motor #{testMotor.Id} has started");
}
// Stop a test
await testMotor.StopTest();
Refresh the available motors if the vehicle configuration changes:
// Refresh
await motorTestClient.Refresh();
IMotorTestClient
Property | Type | Description |
|---|---|---|
|
| Testable motors with telemetry support. |
Method | Return Type | Description |
|---|---|---|
|
| Updates |
IMotorTestClient.Refresh
Parameter | Type | Description |
|---|---|---|
|
| An optional token to cancel the operation. |
Implementations
The current implementation of IMotorTestClient and ITestMotor supports ArduCopter devices:
Last modified: 16 July 2026