.NET SDK Documentation

    Show / Hide Table of Contents

    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 RequestControl(Int32) method to request control of Vector and ReleaseControl() to release control. Unless you use priority level OverrideBehaviors Vector will regain control automatically if he senses an edge or runs low on battery. You can subscribe to the ControlGranted and ControlLost events to get feedback on when you have acquired or lost control.

    Inheritance
    Object
    RobotObject
    Component
    ControlComponent
    Implements
    INotifyPropertyChanged
    Inherited Members
    RobotObject.PropertyChanged
    Namespace: Anki.Vector
    Assembly: Anki.Vector.dll
    Syntax
    public class ControlComponent : Component, INotifyPropertyChanged

    Properties

    | Improve this Doc View Source

    ControlPriority

    Gets the last requested control priority.

    public ControlPriority ControlPriority { get; }
    Property Type
    ControlPriority
    | Improve this Doc View Source

    HasControl

    Gets a value indicating whether SDK has control over Vector

    public bool HasControl { get; }
    Property Type
    Boolean
    | Improve this Doc View Source

    MaintainBehaviorControl

    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
    Boolean

    Methods

    | Improve this Doc View Source

    ReleaseControl()

    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.

    | Improve this Doc View Source

    RequestControl(ControlPriority, Int32)

    Requests the control.

    public Task<bool> RequestControl(ControlPriority priority, int timeout = 10000)
    Parameters
    Type Name Description
    ControlPriority 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
    VectorControlTimeoutException

    Surpassed control timeout

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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 Source

    ControlGranted

    Occurs when control of Vector is granted.

    public event EventHandler<ControlGrantedEventArgs> ControlGranted
    Event Type
    EventHandler<ControlGrantedEventArgs>
    | Improve this Doc View Source

    ControlLost

    Occurs when control of Vector is lost.

    public event EventHandler<ControlLostEventArgs> ControlLost
    Event Type
    EventHandler<ControlLostEventArgs>

    Implements

    System.ComponentModel.INotifyPropertyChanged

    See Also

    Component
    • Improve this Doc
    • View Source
    Back to top Copyright (c) 2019 by Wayne Venables