AForge.Robotics.TeRK.Qwerk.Servos.StopServos C# (CSharp) Метод

StopServos() публичный Метод

Stop specified servos.

The mask array specifies which Qwerk's servo need to be stopped. If value of the mask array is set to , then corresponding servo is stopped.

Incorrect length of array. No connection to Qwerk or its service. Connestion to Qwerk is lost.
public StopServos ( bool mask ) : int[]
mask bool Mask array specifying which servos need to stop.
Результат int[]
            public int[] StopServos( bool[] mask )
            {
                if ( mask.Length != Count )
                {
                    throw new ArgumentException( "Incorrect length of mask array." );
                }

                // check controller
                if ( servoController == null )
                {
                    throw new NotConnectedException( "Qwerk's service is not connected." );
                }

                try
                {
                    TeRKIceLib.ServoCommand command = CreateCommand( );

                    for ( int i = 0; i < Count; i++ )
                    {
                        command.servoMask[i]      = mask[i];
                        command.servoModes[i]     = TeRKIceLib.ServoMode.ServoOff;
                        command.servoPositions[i] = 0;
                        command.servoSpeeds[i]    = 0;
                    }

                    // execute servos' command
                    TeRKIceLib.ServoState state = servoController.execute( command );
                    return state.servoPositions;
                }
                catch
                {
                    throw new ConnectionLostException( "Connection is lost." );
                }
            }

Same methods

Qwerk.Servos::StopServos ( ) : int[]