.NET SDK Documentation

    Show / Hide Table of Contents

    Class WorldComponent

    Vector’s known view of his world.

    This view includes objects and faces it knows about and can currently see with its camera.

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

    Fields

    | Improve this Doc View Source

    ObjectVisibilityTimeout

    The object visibility timeout in milliseconds

    public const int ObjectVisibilityTimeout = 2500
    Field Type
    Int32

    Properties

    | Improve this Doc View Source

    Charger

    Gets the charger if it has been seen by the robot, otherwise this value is null.

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

    IsCubeConnected

    Gets a value indicating whether the is cube connected.

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

    LightCube

    Gets the light cube if it has been seen by the robot, otherwise this value is null.

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

    Objects

    Gets the all objects currently tracked in the world

    public ReadOnlyObservableCollection<ObservableObject> Objects { get; }
    Property Type
    ReadOnlyObservableCollection<ObservableObject>

    Methods

    | Improve this Doc View Source

    ConnectCube()

    Attempt to connect to a cube.

    If a cube is currently connected, this will do nothing.

    public Task<StatusCode> ConnectCube()
    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

    CreateFixedCustomObject(Pose, Single, Single, Single, Boolean)

    Defines a cuboid of custom size and places it in the world. It cannot be observed.

    public Task<StatusCode> CreateFixedCustomObject(Pose pose, float xSizeMm, float ySizeMm, float zSizeMm, bool relativeToRobot = false)
    Parameters
    Type Name Description
    Pose pose

    The pose of the object to create.

    Single xSizeMm

    The size of the object (in millimeters) in the x axis.

    Single ySizeMm

    The size of the object (in millimeters) in the y axis.

    Single zSizeMm

    The size of the object (in millimeters) in the z axis.

    Boolean relativeToRobot

    Whether or not the pose given assumes the robot's pose as its origin.

    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

    CubesAvailable()

    Returns the Factory Ids of all available cubes.

    public Task<IEnumerable<string>> CubesAvailable()
    Returns
    Type Description
    Task<IEnumerable<String>>

    A task that represents the asynchronous operation; the task result contains the factory id's of available cubes.

    | Improve this Doc View Source

    DefineCustomObject(CustomObjectType, CustomObjectArchetype, Boolean)

    Defines the custom object with the provided object definition.

    The robot will now detect the markers associated with this object and raise an ObjectObserved event when they are seen. There are 20 custom object types that can be defined.

    public Task<StatusCode> DefineCustomObject(CustomObjectType customObjectType, CustomObjectArchetype archetype, bool isUnique = true)
    Parameters
    Type Name Description
    CustomObjectType customObjectType

    The object type you are binding this custom object definition to.

    CustomObjectArchetype archetype

    The custom object archetype (definition).

    Boolean isUnique

    If True, the robot will assume there is only 1 of this object. (and therefore only 1 of each of any of these markers) in the world.

    Returns
    Type Description
    Task<StatusCode>

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

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    customObjectType - Custom object type cannot be 'None'

    ArgumentException

    Specified Custom object definition is not supported - definition

    | Improve this Doc View Source

    DeleteCustomObjectArchetypes()

    Causes the robot to forget all the custom defined object archetypes.

    The custom objects need to be deleted from Vector before calling this method to ensure none of the archetypes are in use.

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

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

    Exceptions
    Type Condition
    InvalidOperationException

    Cannot delete archetypes because custom objects are in use. Delete all custom objects first.

    | Improve this Doc View Source

    DeleteCustomObjects()

    Causes the robot to forget about all the custom objects it currently knows about.

    public Task<StatusCode> DeleteCustomObjects()
    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

    DeleteFixedCustomObjects()

    Causes the robot to forget about all the fixed custom objects it currently knows about.

    public Task<StatusCode> DeleteFixedCustomObjects()
    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

    DisconnectCube()

    Requests a disconnection from the currently connected cube.

    public Task<StatusCode> DisconnectCube()
    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

    FlashCubeLights()

    Flashes the cube lights.

    Plays the default cube connection animation on the currently connected cube's lights.

    public Task<StatusCode> FlashCubeLights()
    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

    ForgetPreferredCube()

    Forgets the preferred cube.

    'Forget' the robot's preferred cube. This will cause the robot to connect to the cube with the highest RSSI(signal strength) next time a connection is requested.

    public Task<StatusCode> ForgetPreferredCube()
    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

    GetFaceById(Int32)

    Gets the face by face identifier.

    public Face GetFaceById(int faceId)
    Parameters
    Type Name Description
    Int32 faceId

    The face identifier.

    Returns
    Type Description
    Face

    The face matching the ID

    | Improve this Doc View Source

    GetObjectById(Int32)

    Gets an object by object identifier.

    public ObjectWithId GetObjectById(int objectId)
    Parameters
    Type Name Description
    Int32 objectId

    The object identifier.

    Returns
    Type Description
    ObjectWithId

    The observable object matching the ID or null

    Events

    | Improve this Doc View Source

    KnownFaceAppeared

    Triggered when a known face has appeared

    public event EventHandler<KnownFaceAppearedEventArgs> KnownFaceAppeared
    Event Type
    EventHandler<KnownFaceAppearedEventArgs>
    | Improve this Doc View Source

    ObjectAdded

    Occurs when a new object is added to the world. This will occur only once when a new object is first visually identified by the robot. From then on the object will be available in the Objects collection.

    public event EventHandler<ObjectAddedEventArgs> ObjectAdded
    Event Type
    EventHandler<ObjectAddedEventArgs>
    | Improve this Doc View Source

    ObjectAppeared

    Triggered whenever an object is first visually identified by a robot.

    This differs from ObjectObserved in that it’s only triggered when an object initially becomes visible. If it disappears for more than ObjectVisibilityTimeout milliseconds and then is seen again, a ObjectDisappeared will be dispatched, followed by another ObjectAppeared event.

    For continuous tracking information about a visible object, see ObjectObserved.

    public event EventHandler<ObjectAppearedEventArgs> ObjectAppeared
    Event Type
    EventHandler<ObjectAppearedEventArgs>
    | Improve this Doc View Source

    ObjectConnected

    Triggered when the robot connects to the light cube.

    public event EventHandler<ObjectConnectedEventArgs> ObjectConnected
    Event Type
    EventHandler<ObjectConnectedEventArgs>
    | Improve this Doc View Source

    ObjectDisappeared

    Triggered whenever an object that was previously being observed is no longer visible.

    public event EventHandler<ObjectDisappearedEventArgs> ObjectDisappeared
    Event Type
    EventHandler<ObjectDisappearedEventArgs>
    | Improve this Doc View Source

    ObjectDisconnected

    Triggered when the robot disconnects from the light cube

    public event EventHandler<ObjectDisconnectedEventArgs> ObjectDisconnected
    Event Type
    EventHandler<ObjectDisconnectedEventArgs>
    | Improve this Doc View Source

    ObjectEvent

    Occurs when object event occurs.

    public event EventHandler<ObjectEventArgs> ObjectEvent
    Event Type
    EventHandler<ObjectEventArgs>
    | Improve this Doc View Source

    ObjectFinishedMoving

    Triggered when the object has finished moving (the light cube)

    public event EventHandler<ObjectFinishedMovingEventArgs> ObjectFinishedMoving
    Event Type
    EventHandler<ObjectFinishedMovingEventArgs>
    | Improve this Doc View Source

    ObjectMoving

    Triggered when an object is moved (the light cube)

    public event EventHandler<ObjectMovingEventArgs> ObjectMoving
    Event Type
    EventHandler<ObjectMovingEventArgs>
    | Improve this Doc View Source

    ObjectObserved

    Triggered whenever an object is visually identified by the robot.

    A stream of these events are produced while an object is visible to the robot.Each event has an updated image_box field. See ObjectAppeared if you only want to know when an object first becomes visible.

    public event EventHandler<ObjectObservedEventArgs> ObjectObserved
    Event Type
    EventHandler<ObjectObservedEventArgs>
    | Improve this Doc View Source

    ObjectTapped

    Triggered when the light cube is tapped

    public event EventHandler<ObjectTappedEventArgs> ObjectTapped
    Event Type
    EventHandler<ObjectTappedEventArgs>
    | Improve this Doc View Source

    ObjectUpAxisChanged

    Triggered when the light cube's up axis changed.

    public event EventHandler<ObjectUpAxisChangedEventArgs> ObjectUpAxisChanged
    Event Type
    EventHandler<ObjectUpAxisChangedEventArgs>

    Implements

    System.ComponentModel.INotifyPropertyChanged
    • Improve this Doc
    • View Source
    Back to top Copyright (c) 2019 by Wayne Venables