MotorClient class

gRPC client for the Motor component.

Inheritance
Implemented types

Constructors

MotorClient(String name, ClientChannelBase channel)

Properties

channel ClientChannelBase
getter/setter pairoverride
client MotorServiceClient
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
name String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

doCommand(Map<String, dynamic> command) Future<Map<String, dynamic>>
Send/Receive arbitrary commands to the Resource
override
goFor(double rpm, double revolutions, {Map<String, dynamic>? extra}) Future<void>
Spin the Motor the specified number of revolutions at specified rpm. When rpm or revolutions is a negative value, the rotation will be in the backward direction. Note: if both rpm and revolutions are negative, the motor will spin in the forward direction.
override
goTo(double rpm, double positionRevolutions, {Map<String, dynamic>? extra}) Future<void>
Spin the Motor to the specified position (provided in revolutions from home/zero), at the specified speed, in revolutions per minute. Regardless of the directionality of the rpm this function will move the Motor towards the specified position.
override
isMoving({Map<String, dynamic>? extra}) Future<bool>
Get if the Motor is currently moving.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
position({Map<String, dynamic>? extra}) Future<double>
Report the position of the motor based on its encoder. The value returned is the number of revolutions relative to its zero position. This method will raise an exception if position reporting is not supported by the motor.
override
powerState({Map<String, dynamic>? extra}) Future<PowerState>
Returns whether or not the motor is currently running.
override
properties({Map<String, dynamic>? extra}) Future<MotorProperties>
Report a dictionary mapping optional properties to whether it is supported by this motor.
override
resetZeroPosition(double offset, {Map<String, dynamic>? extra}) Future<void>
Set the current position (modified by offset) to be the new zero (home) position.
override
setPower(double powerPct, {Map<String, dynamic>? extra}) Future<void>
Sets the "percentage" of power the Motor should employ between -1 and 1. When powerPct is negative, the rotation will be in the backward direction.
override
stop({Map<String, dynamic>? extra}) Future<void>
Stop the motor immediately, without any gradual step down.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited