roslib
    Preparing search index...

    Class ActionClient<TGoal, TFeedback, TResult>

    An actionlib action client.

    Emits the following events:

    • 'timeout' - If a timeout occurred while sending a goal.
    • 'status' - The status messages received from the action server.
    • 'feedback' - The feedback messages received from the action server.
    • 'result' - The result returned from the action server.

    Type Parameters

    • TGoal = unknown
    • TFeedback = unknown
    • TResult = unknown

    Hierarchy

    • EventEmitter<{ timeout: undefined }>
      • ActionClient
    Index

    Constructors

    • Type Parameters

      • TGoal = unknown
      • TFeedback = unknown
      • TResult = unknown

      Parameters

      • options: {
            actionName: string;
            omitFeedback?: boolean;
            omitResult?: boolean;
            omitStatus?: boolean;
            ros: Ros;
            serverName: string;
            timeout?: number;
        }
        • actionName: string

          The action message name, like 'actionlib_tutorials/FibonacciAction'.

        • OptionalomitFeedback?: boolean

          The flag to indicate whether to omit the feedback channel or not.

        • OptionalomitResult?: boolean

          The flag to indicate whether to omit the result channel or not.

        • OptionalomitStatus?: boolean

          The flag to indicate whether to omit the status channel or not.

        • ros: Ros

          The ROSLIB.Ros connection handle.

        • serverName: string

          The action server name, like '/fibonacci'.

        • Optionaltimeout?: number

          The timeout length when connecting to the action server.

      Returns ActionClient<TGoal, TFeedback, TResult>

    Properties

    actionName: string
    cancelTopic: Topic<Partial<GoalID>>
    feedbackListener: Topic<
        { feedback: TFeedback; status: actionlib_msgs.GoalStatus },
    >
    goals: Partial<Record<string, Goal<TGoal>>> = {}
    goalTopic: Topic<{ goal: TGoal; goal_id: GoalID }>
    omitFeedback?: boolean
    omitResult?: boolean
    omitStatus?: boolean
    receivedStatus: boolean = false

    flag to check if a status has been received

    resultListener: Topic<{ result: TResult; status: actionlib_msgs.GoalStatus }>
    ros: Ros
    serverName: string
    statusListener: Topic<GoalStatusArray>
    timeout?: number
    prefixed: string | boolean

    Methods

    • Type Parameters

      • T extends "timeout"

      Parameters

      • event: T
      • fn: (...args: ArgumentMap<{ timeout: undefined }>[Extract<T, "timeout">]) => void
      • Optionalcontext: any

      Returns this

    • Calls each of the listeners registered for a given event.

      Type Parameters

      • T extends "timeout"

      Parameters

      • event: T
      • ...args: ArgumentMap<{ timeout: undefined }>[Extract<T, "timeout">]

      Returns boolean

    • Return an array listing the events for which the emitter has registered listeners.

      Returns "timeout"[]

    • Return the number of listeners listening to a given event.

      Parameters

      • event: "timeout"

      Returns number

    • Return the listeners registered for a given event.

      Type Parameters

      • T extends "timeout"

      Parameters

      • event: T

      Returns ((...args: ArgumentMap<{ timeout: undefined }>[Extract<T, "timeout">]) => void)[]

    • Type Parameters

      • T extends "timeout"

      Parameters

      • event: T
      • Optionalfn: (...args: ArgumentMap<{ timeout: undefined }>[Extract<T, "timeout">]) => void
      • Optionalcontext: any
      • Optionalonce: boolean

      Returns this

    • Add a listener for a given event.

      Type Parameters

      • T extends "timeout"

      Parameters

      • event: T
      • fn: (...args: ArgumentMap<{ timeout: undefined }>[Extract<T, "timeout">]) => void
      • Optionalcontext: any

      Returns this

    • Add a one-time listener for a given event.

      Type Parameters

      • T extends "timeout"

      Parameters

      • event: T
      • fn: (...args: ArgumentMap<{ timeout: undefined }>[Extract<T, "timeout">]) => void
      • Optionalcontext: any

      Returns this

    • Remove all listeners, or those of the specified event.

      Parameters

      • Optionalevent: "timeout"

      Returns this

    • Remove the listeners of a given event.

      Type Parameters

      • T extends "timeout"

      Parameters

      • event: T
      • Optionalfn: (...args: ArgumentMap<{ timeout: undefined }>[Extract<T, "timeout">]) => void
      • Optionalcontext: any
      • Optionalonce: boolean

      Returns this