.NET SDK Documentation

    Show / Hide Table of Contents

    Class Robot

    The main robot class for managing Vector.

    The Robot object is responsible for managing the state and connections to a Vector, and is typically the entry-point to running the SDK.

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

    Constructors

    | Improve this Doc View Source

    Robot()

    Initializes a new instance of the Robot class.

    public Robot()

    Properties

    | Improve this Doc View Source

    Acceleration

    Gets the current accelerometer reading

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

    Animation

    Gets the animation component.

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

    Audio

    Gets the audio component.

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

    Behavior

    Gets the behavior component

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

    Camera

    Gets the camera component

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

    Capabilities

    Gets the capabilities support by Vector's current firmware

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

    CarryingObjectId

    Gets the ID of the object currently being carried (-1 if none)

    public int CarryingObjectId { get; }
    Property Type
    Int32
    | Improve this Doc View Source

    Control

    Gets the control component

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

    Events

    Gets the events component

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

    Faces

    Gets the face component

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

    FirmwareVersion

    Gets the firmware version. Populated when connected

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

    Gyro

    Gets the current gyroscope reading (x, y, z)

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

    HeadAngleRad

    Gets Vector's head angle (up/down) in radians

    public float HeadAngleRad { get; }
    Property Type
    Single
    | Improve this Doc View Source

    HeadTrackingObjectId

    Gets the ID of the object the head is tracking to (-1 if none)

    public int HeadTrackingObjectId { get; }
    Property Type
    Int32
    | Improve this Doc View Source

    IPAddress

    Gets the current IP address of the robot. Can be null if remote Vector connection is used.

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

    IsConnected

    Gets a value indicating whether the robot is connected.

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

    LastImageTimestamp

    Gets the robot's timestamp for the last image seen.

    public uint LastImageTimestamp { get; }
    Property Type
    UInt32
    | Improve this Doc View Source

    LeftWheelSpeedMmps

    Gets Vector’s left wheel speed in mm/sec

    public float LeftWheelSpeedMmps { get; }
    Property Type
    Single
    | Improve this Doc View Source

    LiftHeightMm

    Gets the height of Vector’s lift from the ground.

    public float LiftHeightMm { get; }
    Property Type
    Single
    | Improve this Doc View Source

    LocalizedToObjectId

    Gets the ID of the object that the robot is localized to (-1 if none)

    public int LocalizedToObjectId { get; }
    Property Type
    Int32
    | Improve this Doc View Source

    Motors

    Gets the motors component

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

    NavMap

    Gets the navmap component.

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

    Photos

    Gets the photo component.

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

    Pose

    Gets the current pose (position and orientation) of Vector.

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

    PoseAngleRad

    Gets Vector's pose angle (heading in X-Y plane) in radians

    public float PoseAngleRad { get; }
    Property Type
    Single
    | Improve this Doc View Source

    PosePitchRad

    Gets Vector’s pose pitch (angle up/down) in radians

    public float PosePitchRad { get; }
    Property Type
    Single
    | Improve this Doc View Source

    Proximity

    Gets the proximity sensor data.

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

    RightWheelSpeedMmps

    Gets Vector's right wheel speed in mm/sec

    public float RightWheelSpeedMmps { get; }
    Property Type
    Single
    | Improve this Doc View Source

    Screen

    Gets the screen component.

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

    Status

    Gets the various status properties of the robot.

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

    Touch

    Gets state related to touch detection.

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

    Vision

    Gets the vision component.

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

    World

    Gets the world component.

    public WorldComponent World { get; }
    Property Type
    WorldComponent

    Methods

    | Improve this Doc View Source

    CheckCloudConnection()

    Checks the cloud connection to Vector

    public Task<CloudConnection> CheckCloudConnection()
    Returns
    Type Description
    Task<CloudConnection>

    A task that represents the asynchronous operation; the task result contains the cloud connection information.

    | Improve this Doc View Source

    CheckUpdateStatus()

    Check if the robot is ready to reboot and update.

    public Task<CheckUpdateStatus> CheckUpdateStatus()
    Returns
    Type Description
    Task<CheckUpdateStatus>

    A task that represents the asynchronous operation; the task result contains the update status.

    | Improve this Doc View Source

    Connect(IRobotConfiguration, Int32, Boolean)

    Connect to Vector on the local network. This will attempt to connect using the configured IP address (if provided) otherwise it will trigger an mDNS query to find Vector's IP address. For connections to Vector over the Internet, use the RemoteConnect(IRemoteRobotConfiguration, Int32) method instead.

    public Task Connect(IRobotConfiguration robotConfiguration, int timeout = 5000, bool useZeroConfig = true)
    Parameters
    Type Name Description
    IRobotConfiguration robotConfiguration

    The robot configuration.

    Int32 timeout

    Timeout in milliseconds

    Boolean useZeroConfig

    if set to true use zero configuration (mDNS).

    Returns
    Type Description
    Task

    A task that represents the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    robotConfiguration

    VectorNotFoundException

    Unable to establish a connection to Vector.

    VectorInvalidVersionException

    Your SDK version is not compatible with Vector’s version.

    | Improve this Doc View Source

    Disconnect()

    Disconnects from the Robot

    public Task Disconnect()
    Returns
    Type Description
    Task

    A task that represents the asynchronous operation.

    | Improve this Doc View Source

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    Releases unmanaged and - optionally - managed resources.

    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    | Improve this Doc View Source

    GetFeatureFlag(String)

    Request the current setting of a feature flag.

    public Task<bool> GetFeatureFlag(string name)
    Parameters
    Type Name Description
    String name

    The name of the feature to retrieve information about

    Returns
    Type Description
    Task<Boolean>

    A task that represents the asynchronous operation; the task result contains the robot setting.

    | Improve this Doc View Source

    GetFeatureFlagList()

    Request the list of the current feature flags.

    public Task<IReadOnlyList<string>> GetFeatureFlagList()
    Returns
    Type Description
    Task<IReadOnlyList<String>>

    A task that represents the asynchronous operation; the task result contains the robot setting.

    Remarks

    To see which flags are enabled, use the Get Feature Flag command.

    | Improve this Doc View Source

    GetLatestAttentionTransfer()

    Requests information about the most recent attention transfer

    public Task<LatestAttentionTransfer> GetLatestAttentionTransfer()
    Returns
    Type Description
    Task<LatestAttentionTransfer>

    A task that represents the asynchronous operation; the task result contains the latest attention transfer.

    | Improve this Doc View Source

    NewConnection(IRobotConfiguration, Int32)

    Connects to Vector and returns a robot instance.

    public static Task<Robot> NewConnection(IRobotConfiguration robotConfiguration, int timeout = 5000)
    Parameters
    Type Name Description
    IRobotConfiguration robotConfiguration

    The robot configuration.

    Int32 timeout

    The connection timeout in milliseconds.

    Returns
    Type Description
    Task<Robot>

    A task that represents the asynchronous operation; the task result contains the connected robot instance

    | Improve this Doc View Source

    NewConnection(Int32)

    Connects to Vector using the first robot found in the configuration file and returns a robot instance.

    public static Task<Robot> NewConnection(int timeout = 5000)
    Parameters
    Type Name Description
    Int32 timeout

    The timeout.

    Returns
    Type Description
    Task<Robot>

    A task that represents the asynchronous operation. The task result contains the connected robot instance.

    Exceptions
    Type Condition
    VectorConfigurationException

    No Robot Configuration found; please run the configuration tool to setup the robot connection.

    | Improve this Doc View Source

    NewConnection(String, Int32)

    Connects to Vector using the robot configuration that matches the name or serial number provided and returns a robot instance.

    public static Task<Robot> NewConnection(string nameOrSerialNumber, int timeout = 5000)
    Parameters
    Type Name Description
    String nameOrSerialNumber

    The name or serial number.

    Int32 timeout

    The timeout.

    Returns
    Type Description
    Task<Robot>

    A task that represents the asynchronous operation. The task result contains the connected robot instance.

    Exceptions
    Type Condition
    VectorConfigurationException

    No Robot Configuration with the name or serial number matching '{nameOrSerialNumber}' found.

    | Improve this Doc View Source

    ReadBatteryState()

    Reads the state of the battery from the robot.

    public Task<BatteryState> ReadBatteryState()
    Returns
    Type Description
    Task<BatteryState>

    A task that represents the asynchronous operation; the task result contains the battery state.

    | Improve this Doc View Source

    ReadRobotLifetimeStats()

    Gets the robot lifetime stats.

    public Task<RobotLifetimeStats> ReadRobotLifetimeStats()
    Returns
    Type Description
    Task<RobotLifetimeStats>

    A task that represents the asynchronous operation; the task result contains the robot lifetime stats.

    | Improve this Doc View Source

    ReadRobotSettings()

    Gets the settings from the robot.

    public Task<RobotSettings> ReadRobotSettings()
    Returns
    Type Description
    Task<RobotSettings>

    A task that represents the asynchronous operation; the task result contains the robot setting.

    | Improve this Doc View Source

    ReadVersionState()

    Reads the the versioning information for Vector, including Vector’s OS version and engine build id.

    public Task<VersionState> ReadVersionState()
    Returns
    Type Description
    Task<VersionState>

    A task that represents the asynchronous operation; The task result contains robot version information.

    | Improve this Doc View Source

    RemoteConnect(IRemoteRobotConfiguration, Int32)

    Connects to the robot using the remote connection information. This is used for connecting to Vector when he's not on the LAN. This requires port forwarding on your router to setup an external connection to Vector. For connecting to Vector on the same network as this application, use the Connect(IRobotConfiguration, Int32, Boolean) method instead.

    public Task RemoteConnect(IRemoteRobotConfiguration robotConfiguration, int timeout = 5000)
    Parameters
    Type Name Description
    IRemoteRobotConfiguration robotConfiguration

    The remote robot configuration.

    Int32 timeout

    The timeout.

    Returns
    Type Description
    Task

    A task that represents the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    robotConfiguration

    VectorConfigurationException

    Remote host not specified for remote connection.

    | Improve this Doc View Source

    StartUpdateEngine()

    Cycles the update-engine service (to start a new check for an update) and sets up a stream of CheckUpdateStatusEventArgs Events.

    public Task<CheckUpdateStatus> StartUpdateEngine()
    Returns
    Type Description
    Task<CheckUpdateStatus>

    A task that represents the asynchronous operation; the task result contains the update status.

    | Improve this Doc View Source

    UpdateAndRestart()

    Updates and restart the robot.

    public Task<StatusCode> UpdateAndRestart()
    Returns
    Type Description
    Task<StatusCode>

    A task that represents the asynchronous operation; the task result contains the result from the robot.

    | Improve this Doc View Source

    UpdateRobotSettings(RobotSettings)

    Updates the robot settings.

    public Task<RobotSettings> UpdateRobotSettings(RobotSettings settings)
    Parameters
    Type Name Description
    RobotSettings settings

    The settings to update.

    Returns
    Type Description
    Task<RobotSettings>

    A task that represents the asynchronous operation; the task result contains the updated settings.

    Events

    | Improve this Doc View Source

    Connected

    Occurs when the robot is fully connected.

    public event EventHandler<ConnectedEventArgs> Connected
    Event Type
    EventHandler<ConnectedEventArgs>
    | Improve this Doc View Source

    Delocalized

    Occurs when robot is delocalized (i.e. whenever Vector no longer knows where he is - e.g.when he's picked up).

    public event EventHandler<DelocalizedEventArgs> Delocalized
    Event Type
    EventHandler<DelocalizedEventArgs>
    | Improve this Doc View Source

    Disconnected

    Occurs when robot is disconnected.

    public event EventHandler<DisconnectedEventArgs> Disconnected
    Event Type
    EventHandler<DisconnectedEventArgs>
    | Improve this Doc View Source

    Error

    Occurs when there is a background exception.

    public event EventHandler<ErrorEventArgs> Error
    Event Type
    EventHandler<ErrorEventArgs>

    Implements

    System.ComponentModel.INotifyPropertyChanged
    System.IDisposable

    See Also

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