forked from RobotWebTools/rclnodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
238 lines (215 loc) · 8.35 KB
/
Copy pathindex.d.ts
File metadata and controls
238 lines (215 loc) · 8.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/// <reference path="./base.d.ts" />
import { ChildProcess } from 'child_process';
declare module 'rclnodejs' {
type Class = new (...args: any[]) => any;
/**
* Create a node.
*
* @remarks
* See {@link Node}
*
* @param nodeName - The name used to register in ROS.
* @param namespace - The namespace used in ROS, default is an empty string.
* @param context - The context, default is Context.defaultContext().
* @param options - The node options, default is NodeOptions.defaultOptions.
* @param args - The arguments to be passed to the node, default is an empty array.
* @param useGlobalArguments - If true, the node will use global arguments, default is true.
* If false, the node will not use global arguments.
* @returns The new Node instance.
* @deprecated since 0.18.0, Use new Node constructor.
*/
function createNode(
nodeName: string,
namespace?: string,
context?: Context,
options?: NodeOptions,
args?: string[],
useGlobalArguments?: boolean
): Node;
/**
* Create a managed Node that implements a well-defined life-cycle state
* model using the {@link https://github.com/ros2/rcl/tree/master/rcl_lifecycle|ros2 client library (rcl) lifecyle api}.
* @param nodeName - The name used to register in ROS.
* @param namespace - The namespace used in ROS, default is an empty string.
* @param context - The context, default is Context.defaultContext().
* @param options - The options to configure the new node behavior.
* @params enableCommunicationInterface: boolean - Enable lifecycle service interfaces, e.g., GetState.
* @returns The instance of LifecycleNode.
* @deprecated since 0.18.0, Use new LifecycleNode constructor.
*/
function createLifecycleNode(
nodeName: string,
namespace?: string,
context?: Context,
options?: NodeOptions,
enableCommunicationInterface?: boolean
): lifecycle.LifecycleNode;
/**
* Init the module.
*
* @param context - The context, default is Context.defaultContext().
* @param argv - The commandline arguments, the default value is process.argv.
* @returns A Promise.
*/
function init(context?: Context, argv?: string[]): Promise<void>;
/**
* Start detection and processing of units of work.
*
* @param node - The node to be spun.
* @param timeout - ms to wait, block forever if negative, return immediately when 0, default is 10.
* @deprecated since 0.18.0, Use Node.spin(timeout)
*/
function spin(node: Node, timeout?: number): void;
/**
* Execute one item of work or wait until a timeout expires.
*
* @param node - The node to be spun.
* @param timeout - ms to wait, block forever if negative, return immediately when 0, default is 10.
* @deprecated since 0.18.0, Use Node.spinOnce(timeout)*/
function spinOnce(node: Node, timeout?: number): void;
/**
* Stop all activity, destroy all nodes and node components.
*
* @param context - The context, default is Context.defaultContext()
*/
function shutdown(context?: Context): void;
/**
* Shutdown all RCL environments via their contexts.
* @throws Error if there is a problem shutting down the context or while destroying or shutting down a node within it.
*/
function shutdownAll(): void;
/**
* Test if the module is shutdown.
*
* @returns True if the module is shut down, otherwise return false.
*/
function isShutdown(): boolean;
/**
* Get the interface package, which is used by publisher/subscription or client/service.
*
* @param name - The name of interface to be required.
* @returns The object of the required package/interface.
*/
function require<T extends TypeClassName>(name: T): InterfaceType<T>;
function require(name: string): object;
/**
* Generate JavaScript structs files from the IDL of
* messages(.msg) and services(.srv).
* Search packages which locate under path $AMENT_PREFIX_PATH
* and output JS files into the 'generated' folder.
* Any existing files under the generated folder will
* be overwritten.
*
* @returns A Promise.
*/
function regenerateAll(): Promise<void>;
/**
* Judge if the topic or service is hidden,
*
* @remarks
* See {@link http://design.ros2.org/articles/topic_and_service_names.html#hidden-topic-or-service-names}
*
* @param name - Name of topic or service.
* @returns True if a given topic or service name is hidden, otherwise False.
*/
function isTopicOrServiceHidden(name: string): boolean;
/**
* Expand a given topic name using given node name and namespace.
*
* @param topicName - Topic name to be expanded.
* @param nodeName - Name of the node that this topic is associated with.
* @param nodeNamespace - Namespace that the topic is within.
* @returns Expanded topic name which is fully qualified.
*/
function expandTopicName(
topicName: string,
nodeName: string,
nodeNamespace?: string
): string;
/**
* Create a plain JavaScript message object.
*
* @param type - type identifier, acceptable formats could be 'std_msgs/std/String'
* or {package: 'std_msgs', type: 'msg', name: 'String'}
* @returns A Message object or undefined if type is not recognized.
*/
function createMessageObject<T extends TypeClass<MessageTypeClassName>>(
type: T
): MessageType<T>;
/**
* Removes the default signal handler installed by rclnodejs. After calling this, rclnodejs
* will no longer clean itself up when a SIGINT is received, it is the application's
* responsibility to properly shut down all nodes and contexts.
*/
function removeSignalHandlers(): void;
/**
* Get a list of action names and types for action clients associated with a node.
* @param node - The node used for discovery.
* @param nodeName - The name of a remote node to get action clients for.
* @param namespace - Namespace of the remote node.
* @returns An array of the names and types.
*/
function getActionClientNamesAndTypesByNode(
node: Node,
nodeName: string,
namespace: string
): NamesAndTypesQueryResult;
/**
* Get a list of action names and types for action servers associated with a node.
* @param node - The node used for discovery.
* @param nodeName - The name of a remote node to get action servers for.
* @param namespace - Namespace of the remote node.
* @returns An array of the names and types.
*/
function getActionServerNamesAndTypesByNode(
node: Node,
nodeName: string,
namespace: string
): NamesAndTypesQueryResult;
/**
* Get a list of action names and types.
* @param node - The node used for discovery.
* @returns An array of the names and types.
*/
function getActionNamesAndTypes(node: Node): NamesAndTypesQueryResult;
/**
* Serialize a message to a Buffer.
*
* @param message - The message to be serialized.
* @param typeClass - The type class of the message.
* @returns A Buffer containing the serialized message.
*/
function serializeMessage(message: object, typeClass: Class): Buffer;
/**
* Deserialize a message from a Buffer.
*
* @param buffer - The Buffer containing the serialized message.
* @param typeClass - The type class of the message.
* @returns An Object representing the deserialized message.
*/
function deserializeMessage(buffer: Buffer, typeClass: Class): object;
/**
* Run a ROS2 package executable using 'ros2 run' command.
* @param {string} packageName - The name of the ROS2 package.
* @param {string} executableName - The name of the executable to run.
* @param {string[]} [args=[]] - Additional arguments to pass to the executable.
* @return {Promise<{process: ChildProcess}>} A Promise that resolves with the process.
*/
function ros2Run(
packageName: string,
executableName: string,
args: string[]
): Promise<{ process: ChildProcess }>;
/**
* Run a ROS2 launch file using 'ros2 launch' command.
* @param {string} packageName - The name of the ROS2 package.
* @param {string} launchFile - The name of the launch file to run.
* @param {string[]} [args=[]] - Additional arguments to pass to the launch file.
* @return {Promise<{process: ChildProcess}>} A Promise that resolves with the process.
*/
function ros2Launch(
packageName: string,
launchFile: string,
args: string[]
): Promise<{ process: ChildProcess }>;
}