CrazyflieClient.CrazyflieController.CommanderSetpointThread C# (CSharp) Method

CommanderSetpointThread() private method

private CommanderSetpointThread ( CancellationToken cancellationToken ) : void
cancellationToken System.Threading.CancellationToken
return void
        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));
            }
        }
    }