Class MotorComponent
Controls the low-level motor functions.
Implements
Inherited Members
Namespace: Anki.Vector
Assembly: Anki.Vector.dll
Syntax
public class MotorComponent : Component, INotifyPropertyChanged
Methods
| Improve this Doc View SourceDrive(DriveDirection, TurnDirection, MotorSpeed)
Drives Vector based on direction and speed
public Task<StatusCode> Drive(DriveDirection driveDirection, TurnDirection turnDirection, MotorSpeed speed = MotorSpeed.Medium)
Parameters
Type | Name | Description |
---|---|---|
DriveDirection | driveDirection | The drive direction. |
TurnDirection | turnDirection | The turn direction. |
MotorSpeed | speed | The speed. |
Returns
Type | Description |
---|---|
Task<StatusCode> | A task that represents the asynchronous operation; the task result contains the result from the robot. |
Remarks
Requires behavior control; see RequestControl(Int32).
MoveHead(MoveDirection, MotorSpeed)
Moves the head based on direction and speed
public Task<StatusCode> MoveHead(MoveDirection moveDirection, MotorSpeed speed = MotorSpeed.Medium)
Parameters
Type | Name | Description |
---|---|---|
MoveDirection | moveDirection | The move direction. |
MotorSpeed | speed | The speed. |
Returns
Type | Description |
---|---|
Task<StatusCode> | A task that represents the asynchronous operation; the task result contains the result from the robot. |
Remarks
Requires behavior control; see RequestControl(Int32).
MoveLift(MoveDirection, MotorSpeed)
Moves the lift based on direction and speed
public Task<StatusCode> MoveLift(MoveDirection moveDirection, MotorSpeed speed = MotorSpeed.Medium)
Parameters
Type | Name | Description |
---|---|---|
MoveDirection | moveDirection | The move direction. |
MotorSpeed | speed | The speed. |
Returns
Type | Description |
---|---|
Task<StatusCode> | A task that represents the asynchronous operation. |
Remarks
Requires behavior control; see RequestControl(Int32).
SetHeadMotor(Single)
Tell Vector’s head motor to move with a certain speed. Positive speed for up, negative speed for down. To unlock the head track call with speed of zero (0).
public Task<StatusCode> SetHeadMotor(float speed)
Parameters
Type | Name | Description |
---|---|---|
Single | speed | Motor speed for Vector’s head, measured in radians per second. |
Returns
Type | Description |
---|---|
Task<StatusCode> | A task that represents the asynchronous operation; the task result contains the result from the robot. |
Remarks
Requires behavior control; see RequestControl(Int32).
SetLiftMotor(Single)
Tell Vector’s lift motor to move with a certain speed. Positive speed for up, negative speed for down. To unlock the lift track call with speed of zero (0).
public Task<StatusCode> SetLiftMotor(float speed)
Parameters
Type | Name | Description |
---|---|---|
Single | speed | Motor speed for Vector’s lift, measured in radians per second. |
Returns
Type | Description |
---|---|
Task<StatusCode> | A task that represents the asynchronous operation; the task result contains the result from the robot. |
Remarks
Requires behavior control; see RequestControl(Int32).
SetWheelMotors(Single, Single, Single, Single)
Tell Vector to move his wheels / treads at a given speed. The wheels will continue to move at that speed until commanded to drive at a new speed. To unlock the wheel track set all speeds to zero (0).
public Task<StatusCode> SetWheelMotors(float leftWheelSpeed, float rightWheelSpeed, float leftWheelAccel = 0F, float rightWheelAccel = 0F)
Parameters
Type | Name | Description |
---|---|---|
Single | leftWheelSpeed | Speed of the left tread (in millimeters per second) |
Single | rightWheelSpeed | Speed of the right tread (in millimeters per second) |
Single | leftWheelAccel | Acceleration of left tread (in millimeters per second squared) |
Single | rightWheelAccel | Acceleration of right tread (in millimeters per second squared) |
Returns
Type | Description |
---|---|
Task<StatusCode> | A task that represents the asynchronous operation; the task result contains the result from the robot. |
Remarks
Requires behavior control; see RequestControl(Int32).
StopAllMotors()
Tell Vector to stop all motors.
public Task<StatusCode> StopAllMotors()
Returns
Type | Description |
---|---|
Task<StatusCode> | A task that represents the asynchronous operation; the task result contains the result from the robot. |
Remarks
Requires behavior control; see RequestControl(Int32).