Motor class abstract

Motor represents a physical motor.

Inheritance
Implementers

Constructors

Motor()

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
finalinherited
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
inherited
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.
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.
isMoving({Map<String, dynamic>? extra}) Future<bool>
Get if the Motor is currently moving.
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.
powerState({Map<String, dynamic>? extra}) Future<PowerState>
Returns whether or not the motor is currently running.
properties({Map<String, dynamic>? extra}) Future<MotorProperties>
Report a dictionary mapping optional properties to whether it is supported by this motor.
resetZeroPosition(double offset, {Map<String, dynamic>? extra}) Future<void>
Set the current position (modified by offset) to be the new zero (home) position.
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.
stop({Map<String, dynamic>? extra}) Future<void>
Stop the motor immediately, without any gradual step down.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

fromRobot(RobotClient robot, String name) Motor
Get the Motor named name from the provided robot.
getResourceName(String name) ResourceName
Get the ResourceName for this Motor with the given name

Constants

subtype → const Subtype