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 );
Datei anzeigen Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Public Methods

Method 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

Method Description
CreateCommand ( ) : TeRK.MotorCommand
ExecuteCommand ( TeRK command ) : void

Method Details

Motors() public method

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 method

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.
return void

StopMotor() public method

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, ).
return void

StopMotors() public method

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