C# Class 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 );
Afficher le fichier Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
CreateCommand ( ) : TeRK.MotorCommand
ExecuteCommand ( TeRK command ) : void

Method Details

Motors() public méthode

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() public méthode

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.
Résultat void

StopMotor() public méthode

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, ).
Résultat void

StopMotors() public méthode

Stop all motors.
No connection to Qwerk or its service. Connestion to Qwerk is lost.
public StopMotors ( ) : void
Résultat void