UNPKG

roslib

Version:

The standard ROS Javascript Library

35 lines (34 loc) 1.12 kB
import { default as Ros } from '../core/Ros.ts'; import { EventEmitter } from 'eventemitter3'; import { actionlib_msgs } from '../types/actionlib_msgs.ts'; /** * An actionlib action listener. * * Emits the following events: * * '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. * * */ export default class ActionListener<TGoal, TFeedback, TResult> extends EventEmitter<{ status: actionlib_msgs.GoalStatus; feedback: [TFeedback]; result: [TResult]; goal: [TGoal]; }> { ros: Ros; serverName: string; actionName: string; /** * @param options * @param options.ros - The ROSLIB.Ros connection handle. * @param options.serverName - The action server name, like '/fibonacci'. * @param options.actionName - The action message name, like 'actionlib_tutorials/FibonacciAction'. */ constructor({ ros, serverName, actionName, }: { ros: Ros; serverName: string; actionName: string; }); }