private async void CommanderSetpointThread(CancellationToken cancellationToken)
{
// Write commander packets as fast as possible in a loop until cancelled
while(!cancellationToken.IsCancellationRequested)
{
FlightControlAxes axes = await flightController.GetFlightControlAxes();
await bthCrtp.WriteCommanderPacket(
(float)(axes.roll * maxPitchRollRate),
(float)(axes.pitch * maxPitchRollRate),
(float)(axes.yaw * maxYawRate),
(ushort)(axes.thrust * maxThrustPercent * MaxThrust));
}
}
}