Class ReserveBehaviorControl
A ReserveBehaviorControl object can be used to suppress the ordinary idle behaviors of the Robot and keep Vector still between SDK control instances.
Care must be taken when blocking background behaviors, as this may make Vector appear non-responsive.
As long as this object is not disposed, background behaviors will not activate, keeping Vector still while other SDK scripts may take control. Highest-level behaviors like returning to the charger due to low battery will still activate.
If there is a need to keep background behaviors from activating in a single script, the class may be used to reserve behavior control while in scope.
Implements
Namespace: Anki.Vector
Assembly: Anki.Vector.dll
Syntax
public class ReserveBehaviorControl : IDisposable
Constructors
| Improve this Doc View SourceReserveBehaviorControl(RobotConfiguration, Boolean)
Initializes a new instance of the ReserveBehaviorControl class.
public ReserveBehaviorControl(RobotConfiguration robotConfiguration, bool reserveControl = true)
Parameters
| Type | Name | Description |
|---|---|---|
| RobotConfiguration | robotConfiguration | The robot configuration. |
| Boolean | reserveControl | if set to |
Exceptions
| Type | Condition |
|---|---|
| VectorControlException | Unable to reserve behavior control |
ReserveBehaviorControl(Boolean)
Initializes a new instance of the ReserveBehaviorControl class.
public ReserveBehaviorControl(bool reserveControl = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | reserveControl | if set to |
Exceptions
| Type | Condition |
|---|---|
| VectorConfigurationException | No Robot Configuration found; please run the configuration tool to setup the robot connection. |
Methods
| Improve this Doc View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(Boolean)
Releases unmanaged and - optionally - managed resources.
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | disposing |
|
ReleaseControl()
Releases control of Vector
public Task ReleaseControl()
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous operation. |
ReserveControl()
Reserves control of Vector
public Task ReserveControl()
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous operation. |
Exceptions
| Type | Condition |
|---|---|
| VectorControlException | Unable to reserve behavior control |