Class ControlComponent
Management of the control of Vector's behaviors.
When you connect to Vector with this SDK he will behave normally. Taking control of Vector will disable his internal behaviors (driving around autonomously, responding to voice commands, etc). You are required to take control of Vector in order to execute commands that move Vector or provide other output.
Call the Request
Implements
Inherited Members
Namespace: Anki.Vector
Assembly: Anki.Vector.dll
Syntax
public class ControlComponent : Component, INotifyPropertyChanged
Properties
| Improve this Doc View SourceControlPriority
Gets the last requested control priority.
public ControlPriority ControlPriority { get; }
Property Type
| Improve this Doc View SourceHasControl
Gets a value indicating whether SDK has control over Vector
public bool HasControl { get; }
Property Type
| Improve this Doc View SourceMaintainBehaviorControl
Gets a value indicating whether SDK will attempt to acquire control automatically when a behavior method is called after losing control to higher priority behaviors such as returning home to charge a low battery.
public bool MaintainBehaviorControl { get; }
Property Type
Methods
| Improve this Doc View SourceReleaseControl()
Releases the control of Vector
public Task<bool> ReleaseControl()
Returns
Type | Description |
---|---|
Task<Boolean> | A task that represents the asynchronous operation. The task result indicated whether control was released. |
RequestControl(ControlPriority, Int32)
Requests the control.
public Task<bool> RequestControl(ControlPriority priority, int timeout = 10000)
Parameters
Type | Name | Description |
---|---|---|
Control |
priority | The priority. |
Int32 | timeout | The timeout. |
Returns
Type | Description |
---|---|
Task<Boolean> | A task that represents the asynchronous operation. The task result indicated whether control was granted. |
Exceptions
Type | Condition |
---|---|
Vector |
Surpassed control timeout |
RequestControl(Int32)
Requests the control of Vector.
public Task<bool> RequestControl(int timeout = 10000)
Parameters
Type | Name | Description |
---|---|---|
Int32 | timeout | The timeout in milliseconds. |
Returns
Type | Description |
---|---|
Task<Boolean> | A task that represents the asynchronous operation. The task result indicated whether control was granted. |
WaitForControlChange()
Waits for control to change.
The task will complete when control has changed and the result is true if SDK has control over Vector.
public Task<bool> WaitForControlChange()
Returns
Type | Description |
---|---|
Task<Boolean> | A task that represents the asynchronous operation; the task result contains whether not SDK has control. |
Events
| Improve this Doc View SourceControlGranted
Occurs when control of Vector is granted.
public event EventHandler<ControlGrantedEventArgs> ControlGranted
Event Type
| Improve this Doc View SourceControlLost
Occurs when control of Vector is lost.
public event EventHandler<ControlLostEventArgs> ControlLost