ProtoTwin API
    Preparing search index...

    Class RobotControllerComponent

    The base type for all components.

    Hierarchy (View Summary)

    Index

    Properties

    entity: Entity

    The entity to which the component is attached.

    Accessors

    • get angularAcceleration(): number

      The angular acceleration of the TCP.

      Returns number

      The robot controller will command to use the set angular acceleration/deceleration when performing linear moves.

    • set angularAcceleration(value: number): void

      Parameters

      • value: number

      Returns void

    • get angularSpeed(): number

      The target angular speed of the TCP.

      Returns number

      The robot controller will try to achieve the angular speed when performing linear moves.

    • set angularSpeed(value: number): void

      Parameters

      • value: number

      Returns void

    • get initialized(): boolean

      Whether the component has been initialized.

      Returns boolean

    • get jointAcceleration(): number

      The joint speed multiple.

      Returns number

      The robot controller will command a joint acceleration and deceleration of of the motor's acceleration/deceleration scaled by this multiple. This is used only when performing joint moves.

    • set jointAcceleration(value: number): void

      Parameters

      • value: number

      Returns void

    • get joints(): Handle<Joint>[]

      The (optional) list of joints that should be solved by the robot controller.

      Returns Handle<Joint>[]

      If a list of joints isn't provided then the robot controller will automatically use all joints on any entities that are descendants of the entity to which the robot controller is attached.

    • set joints(value: Handle<Joint>[]): void

      Parameters

      Returns void

    • get jointSpeed(): number

      The target joint speed multiple.

      Returns number

      The robot controller can command a maximum joint speed of the motor's target speed scaled by this multiple. For example, a multiple of 2.0 allows the joints to move up to twice as fast as the target speed set on the motors that are bound to the joints. This is used only when performing joint moves. The actual target speed commanded by the robot controller will depend on the time taken by the most limiting joint, so that all the joints arrive at their target positions at the same time.

    • set jointSpeed(value: number): void

      Parameters

      • value: number

      Returns void

    • get linearAcceleration(): number

      The linear acceleration of the TCP.

      Returns number

      The robot controller will command to use the set linear acceleration/deceleration when performing linear moves.

    • set linearAcceleration(value: number): void

      Parameters

      • value: number

      Returns void

    • get linearSpeed(): number

      The target linear speed of the TCP.

      Returns number

      The robot controller will try to achieve the linear speed when performing linear moves.

    • set linearSpeed(value: number): void

      Parameters

      • value: number

      Returns void

    • get localTCP(): Frame

      The frame of the current TCP in the local-space of the robot.

      Returns Frame

    • get name(): string

      The component name.

      Returns string

    • set name(value: string): void

      Parameters

      • value: string

      Returns void

    • get tcp(): null | Entity

      The current Tool Control Point (TCP) for the robot.

      Returns null | Entity

    • set tcp(value: null | Entity): void

      Parameters

      Returns void

    • get world(): World

      The virtual world to which the owning entity belongs.

      Returns World

    • get worldTCP(): Frame

      The frame of the current TCP in world-space.

      Returns Frame

    Methods

    • Added function called immediately after the component is attached to an entity.

      Returns void

    • Clear any errors, allowing the robot controller to continue execution.

      Returns void

    • Creates a new robot program.

      Returns RobotProgram

      The created program.

      The created program is automatically assigned to the robot controller.

    • Finds a robot program with a given name.

      Parameters

      • name: string

        The name of the program.

      Returns null | RobotProgram

      The robot program.

    • Creates a handle (weak reference) to a trackable object.

      Type Parameters

      Parameters

      • type: TrackableType<T>

        The type of object that is to be referenced.

      • value: null | T = null

        The object that is initially referenced by the handle.

      Returns Handle<T>

      A handle to a trackable object.

      Handles created through this function are automatically cleared when the component is detached/removed.

      const handle = this.handle(Entity, this.world.find("Some Entity"));
      

      const handle = this.handle(MyScriptComponent);
      
    • Asynchronous initialization function called immediately before simulating when the model is initialized.

      Returns Promise<void>

    • Calculates the inverse kinematics to find the active joint parameters that achieve the specified target frame.

      Parameters

      • frame: IFrame

        The target frame, in the local-space of the robot.

      Returns number[]

      The active joint parameters that achieve the target.

    • Transforms a frame from the local-space of the robot to world-space.

      Parameters

      • localFrame: IFrame

        The frame in the local-space of the robot.

      Returns Frame

      The frame in world-space.

    • Commands the robot controller to perform a joint move.

      Parameters

      • frame: IFrame

        The target frame, in the local-space of the robot.

      Returns Future<void>

      The future, which resolves when the move has completed.

    • Commands the robot controller to perform a joint move to intercept the specified moving entity.

      Parameters

      • entity: Entity

        The entity to intercept.

      • Optionaloffset: IFrame

        The offset applied to the entity in the local-space of the robot.

      Returns Future<void>

      The future, which resolves when the move has completed.

    • Commands the robot controller to perform a linear move.

      Parameters

      • frame: IFrame

        The target frame, in the local-space of the robot.

      Returns Future<void>

      The future, which resolves when the move has completed.

    • Commands the robot controller to perform a linear move to intercept the specified moving entity.

      Parameters

      • entity: Entity

        The entity to intercept.

      • Optionaloffset: IFrame

        The offset applied to the entity in the local-space of the robot.

      Returns Future<void>

      The future, which resolves when the move has completed.

    • Commands the robot controller to perform a path move.

      Parameters

      • path: IRobotPath

        The path along which the robot should move.

      Returns Future<void>

      The future, which resolves when the move has completed.

    • Commands the robot controller to perform a servo move.

      Parameters

      • servo: number

        The servo index.

      • position: number

        The target position.

      Returns Future<void>

      The future, which resolves when the move has completed.

    • Commands the robot controller to perform a servos move.

      Parameters

      • positions: number[]

        The target positions.

      Returns Future<void>

      The future, which resolves when the move has completed.

    • Retrieves the current active joint parameters.

      Returns number[]

      The current active joint parameters.

    • Post-update function called after physics has been updated.

      Parameters

      • dt: number

        The timestep (seconds).

      Returns void

    • Asynchronous post-update function called after physics has been updated.

      Parameters

      • dt: number

        The timestep (seconds).

      Returns Promise<void>

    • Removed function called immediately after the component is detached from an entity.

      Returns void

    • Immediately triggers asynchronous initialization if the component hasn't already been initialized.

      Returns Promise<void>

      This can be used in cases where one component references another in its asynchronous initialize function, but it is required that the referenced component has already been asynchronously initialized.

    • Immediately triggers initialization if the component hasn't already been initialized.

      Returns void

      This can be used in cases where one component references another in its initialize function, but it is required that the referenced component has already been initialized.

    • Subscribes to a subscribable object.

      Subscriptions created through this function are automatically unsubscribed when the component is detached/removed.

      Type Parameters

      • T

      Parameters

      • object: Subscribable<T>

        The subscribable object for which to subscribe.

      • subscriber: Subscriber<T>

        The callback function that is triggered when the object's value is updated.

      Returns void

    • The time it will take to perform a joint move.

      Parameters

      • frame: IFrame

        The target frame, in the local-space of the robot.

      Returns number

      The time to complete the joint move.

    • The time it will take to perform a linear move.

      Parameters

      • frame: IFrame

        The target frame, in the local-space of the robot.

      Returns number

      The time to complete the linear move.

    • Unsubscribes from a subscribable object.

      Type Parameters

      • T

      Parameters

      • object: Subscribable<T>

        The object from which to unsubscribe.

      • subscriber: Subscriber<T>

        The callback function for the subscription.

      Returns boolean

      True if the subscription was canceled, false otherwise.

    • Asynchronous update function called every timestep when simulating.

      Parameters

      • dt: number

        The timestep (seconds).

      Returns Promise<void>

    • Transforms a frame from world-space to the local-space of the robot.

      Parameters

      • worldFrame: IFrame

        The frame in world-space.

      Returns Frame

      The frame in the local-space of the robot.