C# Класс AForge.Robotics.TeRK.Qwerk.Motors

Provides access to Qwerk's motors' controllers.

The class allows to manipulate Qwerk's motors. The total number of available motors equals to Motors.Count.

Sample usage:

// get Qwerk's motors service Qwerk.Motors motors = qwerk.GetMotorsService( ); // stop all motors motors.StopMotors( ); // run first motor motors.SetMotorVelocity( 0, 10000 );
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Motors ( AForge.Robotics.TeRK.Qwerk qwerk )

Initializes a new instance of the Qwerk.Motors class.

SetMotorVelocity ( int motor, int velocity ) : void

Set velocity of specified motor.

The method sets specified motor's velocity, which is measured in ticks per second. "Ticks" is a made-up term, which does not depend on specific motor, but is an unknown in distance and rotation (see Qwerk documentation for details).

StopMotor ( int motor ) : void

Stop specified motor.

StopMotors ( ) : void

Stop all motors.

Приватные методы

Метод Описание
CreateCommand ( ) : TeRK.MotorCommand
ExecuteCommand ( TeRK command ) : void

Описание методов

Motors() публичный метод

Initializes a new instance of the Qwerk.Motors class.
The passed reference to object is not connected to /// Qwerk board. Failed connecting to the requested service. Failed accessing to the requested service.
public Motors ( AForge.Robotics.TeRK.Qwerk qwerk )
qwerk AForge.Robotics.TeRK.Qwerk Reference to object, which is connected to Qwerk board.

SetMotorVelocity() публичный метод

Set velocity of specified motor.

The method sets specified motor's velocity, which is measured in ticks per second. "Ticks" is a made-up term, which does not depend on specific motor, but is an unknown in distance and rotation (see Qwerk documentation for details).

Invalid motor is specified. No connection to Qwerk or its service. Connestion to Qwerk is lost.
public SetMotorVelocity ( int motor, int velocity ) : void
motor int Motor to set velocity for, [0, ).
velocity int Velocity to set.
Результат void

StopMotor() публичный метод

Stop specified motor.
Invalid motor is specified. No connection to Qwerk or its service. Connestion to Qwerk is lost.
public StopMotor ( int motor ) : void
motor int Motor to stop, [0, ).
Результат void

StopMotors() публичный метод

Stop all motors.
No connection to Qwerk or its service. Connestion to Qwerk is lost.
public StopMotors ( ) : void
Результат void