@agenticros/core 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +192 -0
- package/README.md +88 -0
- package/dist/banner.d.ts +7 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +25 -0
- package/dist/banner.js.map +1 -0
- package/dist/capabilities.d.ts +101 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +240 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/cmd-vel-twist.d.ts +9 -0
- package/dist/cmd-vel-twist.d.ts.map +1 -0
- package/dist/cmd-vel-twist.js +32 -0
- package/dist/cmd-vel-twist.js.map +1 -0
- package/dist/config.d.ts +1195 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +427 -0
- package/dist/config.js.map +1 -0
- package/dist/discovery.d.ts +113 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +141 -0
- package/dist/discovery.js.map +1 -0
- package/dist/find-robots-for.d.ts +85 -0
- package/dist/find-robots-for.d.ts.map +1 -0
- package/dist/find-robots-for.js +120 -0
- package/dist/find-robots-for.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/memory/factory.d.ts +18 -0
- package/dist/memory/factory.d.ts.map +1 -0
- package/dist/memory/factory.js +51 -0
- package/dist/memory/factory.js.map +1 -0
- package/dist/memory/index.d.ts +3 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +2 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/local/provider.d.ts +29 -0
- package/dist/memory/local/provider.d.ts.map +1 -0
- package/dist/memory/local/provider.js +202 -0
- package/dist/memory/local/provider.js.map +1 -0
- package/dist/memory/mem0/provider.d.ts +66 -0
- package/dist/memory/mem0/provider.d.ts.map +1 -0
- package/dist/memory/mem0/provider.js +310 -0
- package/dist/memory/mem0/provider.js.map +1 -0
- package/dist/memory/types.d.ts +91 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +10 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/mission-registry.d.ts +94 -0
- package/dist/mission-registry.d.ts.map +1 -0
- package/dist/mission-registry.js +123 -0
- package/dist/mission-registry.js.map +1 -0
- package/dist/mission-transcript-sink.d.ts +33 -0
- package/dist/mission-transcript-sink.d.ts.map +1 -0
- package/dist/mission-transcript-sink.js +76 -0
- package/dist/mission-transcript-sink.js.map +1 -0
- package/dist/mission.d.ts +281 -0
- package/dist/mission.d.ts.map +1 -0
- package/dist/mission.js +331 -0
- package/dist/mission.js.map +1 -0
- package/dist/planner/index.d.ts +84 -0
- package/dist/planner/index.d.ts.map +1 -0
- package/dist/planner/index.js +486 -0
- package/dist/planner/index.js.map +1 -0
- package/dist/robots.d.ts +133 -0
- package/dist/robots.d.ts.map +1 -0
- package/dist/robots.js +220 -0
- package/dist/robots.js.map +1 -0
- package/dist/topic-utils.d.ts +47 -0
- package/dist/topic-utils.d.ts.map +1 -0
- package/dist/topic-utils.js +136 -0
- package/dist/topic-utils.js.map +1 -0
- package/dist/transport/factory.d.ts +10 -0
- package/dist/transport/factory.d.ts.map +1 -0
- package/dist/transport/factory.js +40 -0
- package/dist/transport/factory.js.map +1 -0
- package/dist/transport/local/conversion.d.ts +30 -0
- package/dist/transport/local/conversion.d.ts.map +1 -0
- package/dist/transport/local/conversion.js +340 -0
- package/dist/transport/local/conversion.js.map +1 -0
- package/dist/transport/local/entities.d.ts +34 -0
- package/dist/transport/local/entities.d.ts.map +1 -0
- package/dist/transport/local/entities.js +108 -0
- package/dist/transport/local/entities.js.map +1 -0
- package/dist/transport/local/transport.d.ts +53 -0
- package/dist/transport/local/transport.d.ts.map +1 -0
- package/dist/transport/local/transport.js +344 -0
- package/dist/transport/local/transport.js.map +1 -0
- package/dist/transport/rosbridge/actions.d.ts +30 -0
- package/dist/transport/rosbridge/actions.d.ts.map +1 -0
- package/dist/transport/rosbridge/actions.js +61 -0
- package/dist/transport/rosbridge/actions.js.map +1 -0
- package/dist/transport/rosbridge/adapter.d.ts +29 -0
- package/dist/transport/rosbridge/adapter.d.ts.map +1 -0
- package/dist/transport/rosbridge/adapter.js +108 -0
- package/dist/transport/rosbridge/adapter.js.map +1 -0
- package/dist/transport/rosbridge/client.d.ts +55 -0
- package/dist/transport/rosbridge/client.d.ts.map +1 -0
- package/dist/transport/rosbridge/client.js +375 -0
- package/dist/transport/rosbridge/client.js.map +1 -0
- package/dist/transport/rosbridge/services.d.ts +14 -0
- package/dist/transport/rosbridge/services.d.ts.map +1 -0
- package/dist/transport/rosbridge/services.js +25 -0
- package/dist/transport/rosbridge/services.js.map +1 -0
- package/dist/transport/rosbridge/topics.d.ts +28 -0
- package/dist/transport/rosbridge/topics.d.ts.map +1 -0
- package/dist/transport/rosbridge/topics.js +59 -0
- package/dist/transport/rosbridge/topics.js.map +1 -0
- package/dist/transport/rosbridge/types.d.ts +87 -0
- package/dist/transport/rosbridge/types.d.ts.map +1 -0
- package/dist/transport/rosbridge/types.js +6 -0
- package/dist/transport/rosbridge/types.js.map +1 -0
- package/dist/transport/transport.d.ts +39 -0
- package/dist/transport/transport.d.ts.map +1 -0
- package/dist/transport/transport.js +2 -0
- package/dist/transport/transport.js.map +1 -0
- package/dist/transport/types.d.ts +100 -0
- package/dist/transport/types.d.ts.map +1 -0
- package/dist/transport/types.js +5 -0
- package/dist/transport/types.js.map +1 -0
- package/dist/transport/webrtc/signaling-client.d.ts +38 -0
- package/dist/transport/webrtc/signaling-client.d.ts.map +1 -0
- package/dist/transport/webrtc/signaling-client.js +161 -0
- package/dist/transport/webrtc/signaling-client.js.map +1 -0
- package/dist/transport/webrtc/signaling-types.d.ts +112 -0
- package/dist/transport/webrtc/signaling-types.d.ts.map +1 -0
- package/dist/transport/webrtc/signaling-types.js +8 -0
- package/dist/transport/webrtc/signaling-types.js.map +1 -0
- package/dist/transport/webrtc/transport.d.ts +67 -0
- package/dist/transport/webrtc/transport.d.ts.map +1 -0
- package/dist/transport/webrtc/transport.js +406 -0
- package/dist/transport/webrtc/transport.js.map +1 -0
- package/dist/transport/zenoh/adapter.d.ts +47 -0
- package/dist/transport/zenoh/adapter.d.ts.map +1 -0
- package/dist/transport/zenoh/adapter.js +296 -0
- package/dist/transport/zenoh/adapter.js.map +1 -0
- package/dist/transport/zenoh/cdr.d.ts +17 -0
- package/dist/transport/zenoh/cdr.d.ts.map +1 -0
- package/dist/transport/zenoh/cdr.js +170 -0
- package/dist/transport/zenoh/cdr.js.map +1 -0
- package/dist/transport/zenoh/keys.d.ts +21 -0
- package/dist/transport/zenoh/keys.d.ts.map +1 -0
- package/dist/transport/zenoh/keys.js +44 -0
- package/dist/transport/zenoh/keys.js.map +1 -0
- package/dist/transport-pool.d.ts +74 -0
- package/dist/transport-pool.d.ts.map +1 -0
- package/dist/transport-pool.js +135 -0
- package/dist/transport-pool.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { EntityCache } from "./entities.js";
|
|
3
|
+
import { toRosMessage, fromRosMessage, loadMessageClass, clearTypeCache } from "./conversion.js";
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
/** Internal ROS2 topics/services to filter from introspection results. */
|
|
6
|
+
const INTERNAL_TOPIC_PREFIXES = ["/rosout", "/parameter_events", "/agenticros/"];
|
|
7
|
+
const INTERNAL_SERVICE_SUFFIXES = [
|
|
8
|
+
"/describe_parameters",
|
|
9
|
+
"/get_parameter_types",
|
|
10
|
+
"/get_parameters",
|
|
11
|
+
"/list_parameters",
|
|
12
|
+
"/set_parameters",
|
|
13
|
+
"/set_parameters_atomically",
|
|
14
|
+
];
|
|
15
|
+
/**
|
|
16
|
+
* Mode A transport: direct local DDS communication via rclnodejs.
|
|
17
|
+
*
|
|
18
|
+
* When OpenClaw runs on the robot itself, this transport talks to ROS2
|
|
19
|
+
* directly via the local DDS bus — no network intermediary needed.
|
|
20
|
+
*/
|
|
21
|
+
export class LocalTransport {
|
|
22
|
+
domainId;
|
|
23
|
+
status = "disconnected";
|
|
24
|
+
connectionHandlers = new Set();
|
|
25
|
+
/** rclnodejs module — loaded dynamically at runtime (optional dep, no types). */
|
|
26
|
+
rclnodejs = null;
|
|
27
|
+
node = null;
|
|
28
|
+
entityCache = null;
|
|
29
|
+
activeGoals = new Map();
|
|
30
|
+
/** Singleton guard — rclnodejs.init() must only be called once per process. */
|
|
31
|
+
static rclInitialized = false;
|
|
32
|
+
constructor(options) {
|
|
33
|
+
this.domainId = options?.domainId ?? 0;
|
|
34
|
+
}
|
|
35
|
+
// --- Connection lifecycle ---
|
|
36
|
+
async connect() {
|
|
37
|
+
if (this.status === "connected")
|
|
38
|
+
return;
|
|
39
|
+
this.setStatus("connecting");
|
|
40
|
+
try {
|
|
41
|
+
this.rclnodejs = require("rclnodejs");
|
|
42
|
+
// Set domain ID before init if non-default
|
|
43
|
+
if (this.domainId !== 0) {
|
|
44
|
+
process.env.ROS_DOMAIN_ID = String(this.domainId);
|
|
45
|
+
}
|
|
46
|
+
// Global init — only once per process
|
|
47
|
+
if (!LocalTransport.rclInitialized) {
|
|
48
|
+
await this.rclnodejs.init();
|
|
49
|
+
LocalTransport.rclInitialized = true;
|
|
50
|
+
}
|
|
51
|
+
// Use a process-unique node name. If two AgenticROS adapters (e.g. the
|
|
52
|
+
// OpenClaw gateway plugin + the Claude Code MCP server) share the host,
|
|
53
|
+
// a fixed name collides on the DDS bus: rcl logs "Publisher already
|
|
54
|
+
// registered for provided node name" and DDS discovery on the duplicate
|
|
55
|
+
// becomes slow/lossy — listTopics() then returns 0 right after connect.
|
|
56
|
+
const nodeName = `agenticros_local_${process.pid}`;
|
|
57
|
+
this.node = this.rclnodejs.createNode(nodeName);
|
|
58
|
+
this.rclnodejs.spin(this.node);
|
|
59
|
+
this.entityCache = new EntityCache();
|
|
60
|
+
// Give DDS discovery a brief moment to receive announcements from peers
|
|
61
|
+
// before we report "connected". Without this the very first listTopics()
|
|
62
|
+
// can race the executor and return empty even though peers exist.
|
|
63
|
+
// 1500ms was chosen empirically on Jetson + Humble where /arm/*/cmd_pos
|
|
64
|
+
// topics from a sim_arm gz_bridge child take ~1.2s to propagate via
|
|
65
|
+
// multicast (vs ~400ms on x86); the prior 750ms cap caused first
|
|
66
|
+
// list_topics() calls to miss them.
|
|
67
|
+
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
68
|
+
this.setStatus("connected");
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
this.setStatus("disconnected");
|
|
72
|
+
throw err;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async disconnect() {
|
|
76
|
+
if (this.status === "disconnected")
|
|
77
|
+
return;
|
|
78
|
+
// Cancel any active action goals
|
|
79
|
+
for (const [action] of this.activeGoals) {
|
|
80
|
+
try {
|
|
81
|
+
await this.cancelActionGoal(action);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// Best-effort
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
this.activeGoals.clear();
|
|
88
|
+
if (this.entityCache && this.node) {
|
|
89
|
+
this.entityCache.destroyAll(this.node);
|
|
90
|
+
this.entityCache = null;
|
|
91
|
+
}
|
|
92
|
+
if (this.node) {
|
|
93
|
+
this.node.destroy();
|
|
94
|
+
this.node = null;
|
|
95
|
+
}
|
|
96
|
+
if (this.rclnodejs && LocalTransport.rclInitialized) {
|
|
97
|
+
try {
|
|
98
|
+
this.rclnodejs.shutdown();
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
// May already be shut down
|
|
102
|
+
}
|
|
103
|
+
LocalTransport.rclInitialized = false;
|
|
104
|
+
}
|
|
105
|
+
clearTypeCache();
|
|
106
|
+
this.rclnodejs = null;
|
|
107
|
+
this.setStatus("disconnected");
|
|
108
|
+
}
|
|
109
|
+
getStatus() {
|
|
110
|
+
return this.status;
|
|
111
|
+
}
|
|
112
|
+
onConnection(handler) {
|
|
113
|
+
this.connectionHandlers.add(handler);
|
|
114
|
+
return () => {
|
|
115
|
+
this.connectionHandlers.delete(handler);
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
// --- Topics ---
|
|
119
|
+
publish(options) {
|
|
120
|
+
this.ensureConnected();
|
|
121
|
+
const publisher = this.entityCache.getPublisher(this.node, options.topic, options.type);
|
|
122
|
+
const rosMsg = toRosMessage(options.type, options.msg);
|
|
123
|
+
publisher.publish(rosMsg);
|
|
124
|
+
}
|
|
125
|
+
subscribe(options, handler) {
|
|
126
|
+
this.ensureConnected();
|
|
127
|
+
const type = options.type ?? this.resolveTopicType(options.topic);
|
|
128
|
+
if (!type) {
|
|
129
|
+
throw new Error(`Cannot subscribe to ${options.topic}: type is required when it cannot be inferred`);
|
|
130
|
+
}
|
|
131
|
+
return this.entityCache.addSubscription(this.node, options.topic, type, handler);
|
|
132
|
+
}
|
|
133
|
+
// --- Services ---
|
|
134
|
+
async callService(options) {
|
|
135
|
+
this.ensureConnected();
|
|
136
|
+
const type = options.type ?? this.resolveServiceType(options.service);
|
|
137
|
+
if (!type) {
|
|
138
|
+
throw new Error(`Cannot call service ${options.service}: type is required when it cannot be inferred`);
|
|
139
|
+
}
|
|
140
|
+
const client = this.entityCache.getServiceClient(this.node, options.service, type);
|
|
141
|
+
// Wait for service to become available (5s timeout)
|
|
142
|
+
const available = await client.waitForService(5000);
|
|
143
|
+
if (!available) {
|
|
144
|
+
throw new Error(`Service ${options.service} not available after 5 seconds`);
|
|
145
|
+
}
|
|
146
|
+
// Create request from args
|
|
147
|
+
const ServiceClass = loadMessageClass(type);
|
|
148
|
+
const request = new ServiceClass.Request();
|
|
149
|
+
if (options.args) {
|
|
150
|
+
for (const [key, value] of Object.entries(options.args)) {
|
|
151
|
+
request[key] = value;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// Send request with Promise wrapping + timeout
|
|
155
|
+
const response = await this.sendServiceRequest(client, request, 30_000);
|
|
156
|
+
return {
|
|
157
|
+
result: true,
|
|
158
|
+
values: fromRosMessage(response),
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
// --- Actions ---
|
|
162
|
+
async sendActionGoal(options) {
|
|
163
|
+
this.ensureConnected();
|
|
164
|
+
const ActionClass = loadMessageClass(options.actionType);
|
|
165
|
+
const actionClient = new this.rclnodejs.ActionClient(this.node, ActionClass, options.action);
|
|
166
|
+
// Wait for action server (5s)
|
|
167
|
+
const available = await actionClient.waitForServer(5000);
|
|
168
|
+
if (!available) {
|
|
169
|
+
actionClient.destroy();
|
|
170
|
+
throw new Error(`Action server ${options.action} not available after 5 seconds`);
|
|
171
|
+
}
|
|
172
|
+
// Build goal message
|
|
173
|
+
const goal = new ActionClass.Goal();
|
|
174
|
+
if (options.args) {
|
|
175
|
+
for (const [key, value] of Object.entries(options.args)) {
|
|
176
|
+
goal[key] = value;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
try {
|
|
180
|
+
const result = await new Promise((resolve, reject) => {
|
|
181
|
+
const timer = setTimeout(() => {
|
|
182
|
+
this.activeGoals.delete(options.action);
|
|
183
|
+
reject(new Error(`Action ${options.action} timed out after 120 seconds`));
|
|
184
|
+
}, 120_000);
|
|
185
|
+
actionClient.sendGoal(goal, (goalHandle) => {
|
|
186
|
+
// Goal response callback — store for cancellation
|
|
187
|
+
this.activeGoals.set(options.action, goalHandle);
|
|
188
|
+
}, (feedback) => {
|
|
189
|
+
// Feedback callback
|
|
190
|
+
if (options.onFeedback) {
|
|
191
|
+
options.onFeedback(fromRosMessage(feedback));
|
|
192
|
+
}
|
|
193
|
+
}, (resultResponse) => {
|
|
194
|
+
// Result callback
|
|
195
|
+
clearTimeout(timer);
|
|
196
|
+
this.activeGoals.delete(options.action);
|
|
197
|
+
resolve(fromRosMessage(resultResponse));
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
return { result: true, values: result };
|
|
201
|
+
}
|
|
202
|
+
finally {
|
|
203
|
+
actionClient.destroy();
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
async cancelActionGoal(action) {
|
|
207
|
+
const goalHandle = this.activeGoals.get(action);
|
|
208
|
+
if (goalHandle && typeof goalHandle.cancelGoal === "function") {
|
|
209
|
+
await goalHandle.cancelGoal();
|
|
210
|
+
this.activeGoals.delete(action);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// --- Introspection ---
|
|
214
|
+
async listTopics() {
|
|
215
|
+
this.ensureConnected();
|
|
216
|
+
// DDS discovery is asynchronous AND stateful. On a freshly-connected
|
|
217
|
+
// node, getTopicNamesAndTypes() trickles in results as peers respond -
|
|
218
|
+
// the first call may return 0, the second 2, the third all of them.
|
|
219
|
+
//
|
|
220
|
+
// Two issues motivated the current tuning:
|
|
221
|
+
//
|
|
222
|
+
// 1. A short single-stable-hit policy (600ms) was returning truncated
|
|
223
|
+
// views to Claude: e.g. with the AMR sim alone it'd see /cmd_vel
|
|
224
|
+
// etc. on first call, then a second call 2s later would see all
|
|
225
|
+
// 29 topics including /arm/*/cmd_pos. Claude only calls
|
|
226
|
+
// list_topics once and was missing arm joint topics entirely.
|
|
227
|
+
//
|
|
228
|
+
// 2. DDS multicast announcements on Jetson take longer than on x86 -
|
|
229
|
+
// we routinely see /arm/* topics appear ~1.5s after first call.
|
|
230
|
+
//
|
|
231
|
+
// Fix: require 3 consecutive matching polls (2 stable hits at 300ms
|
|
232
|
+
// intervals = ~900ms of stability), with a 6 s deadline. Worst case
|
|
233
|
+
// ~900ms latency on a steady graph, ~5s+ if discovery is still
|
|
234
|
+
// streaming. The min-count guard (>=3) avoids exiting early when only
|
|
235
|
+
// /clock + /tf + /tf_static have come through.
|
|
236
|
+
const externalFilter = (t) => !INTERNAL_TOPIC_PREFIXES.some((prefix) => t.name.startsWith(prefix));
|
|
237
|
+
const deadline = Date.now() + 6000;
|
|
238
|
+
const MIN_STABLE_COUNT = 3;
|
|
239
|
+
const REQUIRED_STABLE_HITS = 2;
|
|
240
|
+
let raw = [];
|
|
241
|
+
let prevCount = -1;
|
|
242
|
+
let stableHits = 0;
|
|
243
|
+
while (Date.now() < deadline) {
|
|
244
|
+
raw = this.node.getTopicNamesAndTypes();
|
|
245
|
+
const externalCount = raw.filter(externalFilter).length;
|
|
246
|
+
if (externalCount === prevCount && externalCount >= MIN_STABLE_COUNT) {
|
|
247
|
+
stableHits++;
|
|
248
|
+
if (stableHits >= REQUIRED_STABLE_HITS)
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
stableHits = 0;
|
|
253
|
+
prevCount = externalCount;
|
|
254
|
+
}
|
|
255
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
256
|
+
}
|
|
257
|
+
return raw.filter(externalFilter).map((t) => ({ name: t.name, type: t.types[0] ?? "" }));
|
|
258
|
+
}
|
|
259
|
+
async listServices() {
|
|
260
|
+
this.ensureConnected();
|
|
261
|
+
const namesAndTypes = this.node.getServiceNamesAndTypes();
|
|
262
|
+
return namesAndTypes
|
|
263
|
+
.filter((s) => !INTERNAL_SERVICE_SUFFIXES.some((suffix) => s.name.endsWith(suffix)))
|
|
264
|
+
.filter((s) => !INTERNAL_TOPIC_PREFIXES.some((prefix) => s.name.startsWith(prefix)))
|
|
265
|
+
.map((s) => ({ name: s.name, type: s.types[0] ?? "" }));
|
|
266
|
+
}
|
|
267
|
+
async listActions() {
|
|
268
|
+
// Same feedback-topic heuristic as rosbridge/adapter.ts
|
|
269
|
+
const topics = await this.listTopics();
|
|
270
|
+
const actions = [];
|
|
271
|
+
const feedbackSuffix = "/_action/feedback";
|
|
272
|
+
for (const topic of topics) {
|
|
273
|
+
if (topic.name.endsWith(feedbackSuffix)) {
|
|
274
|
+
const actionName = topic.name.slice(0, -feedbackSuffix.length);
|
|
275
|
+
let actionType = topic.type;
|
|
276
|
+
if (actionType.endsWith("_FeedbackMessage")) {
|
|
277
|
+
actionType = actionType.slice(0, -"_FeedbackMessage".length);
|
|
278
|
+
}
|
|
279
|
+
actions.push({ name: actionName, type: actionType });
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return actions;
|
|
283
|
+
}
|
|
284
|
+
// --- Private helpers ---
|
|
285
|
+
setStatus(status) {
|
|
286
|
+
this.status = status;
|
|
287
|
+
for (const handler of this.connectionHandlers) {
|
|
288
|
+
handler(status);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
ensureConnected() {
|
|
292
|
+
if (this.status !== "connected" || !this.node || !this.entityCache) {
|
|
293
|
+
throw new Error("LocalTransport is not connected");
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Resolve a topic's type from the node's graph introspection.
|
|
298
|
+
* Returns undefined if the topic is not yet known.
|
|
299
|
+
*/
|
|
300
|
+
resolveTopicType(topic) {
|
|
301
|
+
if (!this.node)
|
|
302
|
+
return undefined;
|
|
303
|
+
const namesAndTypes = this.node.getTopicNamesAndTypes();
|
|
304
|
+
const entry = namesAndTypes.find((t) => t.name === topic);
|
|
305
|
+
return entry?.types[0];
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Resolve a service's type from the node's graph introspection.
|
|
309
|
+
* Returns undefined if the service is not yet known.
|
|
310
|
+
*/
|
|
311
|
+
resolveServiceType(service) {
|
|
312
|
+
if (!this.node)
|
|
313
|
+
return undefined;
|
|
314
|
+
const namesAndTypes = this.node.getServiceNamesAndTypes();
|
|
315
|
+
const entry = namesAndTypes.find((s) => s.name === service);
|
|
316
|
+
return entry?.types[0];
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Wrap rclnodejs callback-based sendRequest in a Promise with timeout.
|
|
320
|
+
*/
|
|
321
|
+
sendServiceRequest(client, request, timeoutMs) {
|
|
322
|
+
return new Promise((resolve, reject) => {
|
|
323
|
+
const timer = setTimeout(() => {
|
|
324
|
+
reject(new Error(`Service call timed out after ${timeoutMs}ms`));
|
|
325
|
+
}, timeoutMs);
|
|
326
|
+
try {
|
|
327
|
+
client.sendRequest(request, (response) => {
|
|
328
|
+
clearTimeout(timer);
|
|
329
|
+
if (response) {
|
|
330
|
+
resolve(response);
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
reject(new Error("Service returned no response"));
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
catch (err) {
|
|
338
|
+
clearTimeout(timer);
|
|
339
|
+
reject(err);
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/transport/local/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAiB5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjG,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAM/C,0EAA0E;AAC1E,MAAM,uBAAuB,GAAG,CAAC,SAAS,EAAE,mBAAmB,EAAE,cAAc,CAAC,CAAC;AACjF,MAAM,yBAAyB,GAAG;IAChC,sBAAsB;IACtB,sBAAsB;IACtB,iBAAiB;IACjB,kBAAkB;IAClB,iBAAiB;IACjB,4BAA4B;CAC7B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,OAAO,cAAc;IACjB,QAAQ,CAAS;IACjB,MAAM,GAAqB,cAAc,CAAC;IAC1C,kBAAkB,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC1D,iFAAiF;IACzE,SAAS,GAAQ,IAAI,CAAC;IACtB,IAAI,GAAQ,IAAI,CAAC;IACjB,WAAW,GAAuB,IAAI,CAAC;IACvC,W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,GACjB,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC;QACtC,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;QAC5D,OAAO,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACK,kBAAkB,CAAC,MAAW,EAAE,OAAY,EAAE,SAAiB;QACrE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC5B,MAAM,CAAC,IAAI,KAAK,CAAC,gCAAgC,SAAS,IAAI,CAAC,CAAC,CAAC;YACnE,CAAC,EAAE,SAAS,CAAC,CAAC;YAEd,IAAI,CAAC;gBACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,QAAa,EAAE,EAAE;oBAC5C,YAAY,CAAC,KAAK,CAAC,CAAC;oBACpB,IAAI,QAAQ,EAAE,CAAC;wBACb,OAAO,CAAC,QAAQ,CAAC,CAAC;oBACpB,CAAC;yBAAM,CAAC;wBACN,MAAM,CAAC,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC,CAAC;oBACpD,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,YAAY,CAAC,KAAK,CAAC,CAAC;gBACpB,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { RosbridgeClient } from "./client.js";
|
|
2
|
+
import type { ActionResultMessage, ActionFeedbackMessage } from "./types.js";
|
|
3
|
+
export interface ActionGoalOptions {
|
|
4
|
+
action: string;
|
|
5
|
+
actionType: string;
|
|
6
|
+
args?: Record<string, unknown>;
|
|
7
|
+
onFeedback?: (feedback: ActionFeedbackMessage) => void;
|
|
8
|
+
timeoutMs?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Client for sending action goals and receiving feedback/results.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ActionClient {
|
|
14
|
+
private client;
|
|
15
|
+
constructor(client: RosbridgeClient);
|
|
16
|
+
/**
|
|
17
|
+
* Send an action goal and wait for the result.
|
|
18
|
+
*
|
|
19
|
+
* @param options - Action goal options including feedback handler
|
|
20
|
+
* @returns The action result
|
|
21
|
+
*/
|
|
22
|
+
sendGoal(options: ActionGoalOptions): Promise<ActionResultMessage>;
|
|
23
|
+
/**
|
|
24
|
+
* Cancel an in-progress action goal.
|
|
25
|
+
*
|
|
26
|
+
* @param action - The action server name
|
|
27
|
+
*/
|
|
28
|
+
cancelGoal(action: string): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/transport/rosbridge/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,eAAe;IAE3C;;;;;OAKG;IACG,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA0CxE;;;;OAIG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAOhD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client for sending action goals and receiving feedback/results.
|
|
3
|
+
*/
|
|
4
|
+
export class ActionClient {
|
|
5
|
+
client;
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Send an action goal and wait for the result.
|
|
11
|
+
*
|
|
12
|
+
* @param options - Action goal options including feedback handler
|
|
13
|
+
* @returns The action result
|
|
14
|
+
*/
|
|
15
|
+
async sendGoal(options) {
|
|
16
|
+
const id = this.client.nextId("action");
|
|
17
|
+
const timeoutMs = options.timeoutMs ?? 120_000; // Actions can be long-running
|
|
18
|
+
// Register feedback handler if provided
|
|
19
|
+
let removeFeedbackHandler = null;
|
|
20
|
+
if (options.onFeedback) {
|
|
21
|
+
const feedbackKey = `__action_feedback__${id}`;
|
|
22
|
+
removeFeedbackHandler = this.client.onMessage(feedbackKey, (msg) => {
|
|
23
|
+
options.onFeedback(msg);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
// Create promise that resolves on action_result
|
|
27
|
+
const resultPromise = new Promise((resolve, reject) => {
|
|
28
|
+
this.client.registerPending(id, (result) => resolve(result), reject, timeoutMs);
|
|
29
|
+
});
|
|
30
|
+
// Send the goal
|
|
31
|
+
this.client.send({
|
|
32
|
+
op: "send_action_goal",
|
|
33
|
+
id,
|
|
34
|
+
action: options.action,
|
|
35
|
+
action_type: options.actionType,
|
|
36
|
+
args: options.args,
|
|
37
|
+
});
|
|
38
|
+
try {
|
|
39
|
+
return await resultPromise;
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
// Clean up feedback handler regardless of outcome
|
|
43
|
+
if (removeFeedbackHandler) {
|
|
44
|
+
removeFeedbackHandler();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Cancel an in-progress action goal.
|
|
50
|
+
*
|
|
51
|
+
* @param action - The action server name
|
|
52
|
+
*/
|
|
53
|
+
async cancelGoal(action) {
|
|
54
|
+
this.client.send({
|
|
55
|
+
op: "cancel_action_goal",
|
|
56
|
+
id: this.client.nextId("cancel"),
|
|
57
|
+
action,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/transport/rosbridge/actions.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,MAAM,OAAO,YAAY;IACH;IAApB,YAAoB,MAAuB;QAAvB,WAAM,GAAN,MAAM,CAAiB;IAAG,CAAC;IAE/C;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CAAC,OAA0B;QACvC,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACxC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,CAAC,8BAA8B;QAE9E,wCAAwC;QACxC,IAAI,qBAAqB,GAAwB,IAAI,CAAC;QACtD,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,MAAM,WAAW,GAAG,sBAAsB,EAAE,EAAE,CAAC;YAC/C,qBAAqB,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE;gBACjE,OAAO,CAAC,UAAW,CAAC,GAAuC,CAAC,CAAC;YAC/D,CAAC,CAAC,CAAC;QACL,CAAC;QAED,gDAAgD;QAChD,MAAM,aAAa,GAAG,IAAI,OAAO,CAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACzE,IAAI,CAAC,MAAM,CAAC,eAAe,CACzB,EAAE,EACF,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAA6B,CAAC,EAClD,MAAM,EACN,SAAS,CACV,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,gBAAgB;QAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACf,EAAE,EAAE,kBAAkB;YACtB,EAAE;YACF,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,WAAW,EAAE,OAAO,CAAC,UAAU;YAC/B,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,OAAO,MAAM,aAAa,CAAC;QAC7B,CAAC;gBAAS,CAAC;YACT,kDAAkD;YAClD,IAAI,qBAAqB,EAAE,CAAC;gBAC1B,qBAAqB,EAAE,CAAC;YAC1B,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,UAAU,CAAC,MAAc;QAC7B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACf,EAAE,EAAE,oBAAoB;YACxB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;YAChC,MAAM;SACP,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RosTransport } from "../transport.js";
|
|
2
|
+
import type { ConnectionStatus, ConnectionHandler, Subscription, PublishOptions, AdvertiseOptions, SubscribeOptions, ServiceCallOptions, ServiceCallResult, ActionGoalOptions, ActionResult, TopicInfo, ServiceInfo, ActionInfo, MessageHandler } from "../types.js";
|
|
3
|
+
import type { RosbridgeClientOptions } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* RosTransport adapter that wraps the existing RosbridgeClient.
|
|
6
|
+
*
|
|
7
|
+
* This is the Mode B (Local Network) transport. It connects to a
|
|
8
|
+
* rosbridge_server running on the robot via WebSocket and translates
|
|
9
|
+
* RosTransport method calls into rosbridge protocol messages.
|
|
10
|
+
*/
|
|
11
|
+
export declare class RosbridgeTransport implements RosTransport {
|
|
12
|
+
private client;
|
|
13
|
+
private actionClient;
|
|
14
|
+
constructor(options: RosbridgeClientOptions);
|
|
15
|
+
connect(): Promise<void>;
|
|
16
|
+
disconnect(): Promise<void>;
|
|
17
|
+
getStatus(): ConnectionStatus;
|
|
18
|
+
onConnection(handler: ConnectionHandler): () => void;
|
|
19
|
+
advertise(options: AdvertiseOptions): void;
|
|
20
|
+
publish(options: PublishOptions): void;
|
|
21
|
+
subscribe(options: SubscribeOptions, handler: MessageHandler): Subscription;
|
|
22
|
+
callService(options: ServiceCallOptions): Promise<ServiceCallResult>;
|
|
23
|
+
sendActionGoal(options: ActionGoalOptions): Promise<ActionResult>;
|
|
24
|
+
cancelActionGoal(action: string): Promise<void>;
|
|
25
|
+
listTopics(): Promise<TopicInfo[]>;
|
|
26
|
+
listServices(): Promise<ServiceInfo[]>;
|
|
27
|
+
listActions(): Promise<ActionInfo[]>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/transport/rosbridge/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,UAAU,EACV,cAAc,EACf,MAAM,aAAa,CAAC;AAKrB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD;;;;;;GAMG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IACrD,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,YAAY,CAAe;gBAEvB,OAAO,EAAE,sBAAsB;IAKrC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC,SAAS,IAAI,gBAAgB;IAI7B,YAAY,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,IAAI;IAIpD,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAQ1C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAKtC,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,cAAc,GAAG,YAAY;IAUrE,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAapE,cAAc,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAejE,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C,UAAU,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAYlC,YAAY,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAYtC,WAAW,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;CAsB3C"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { RosbridgeClient } from "./client.js";
|
|
2
|
+
import { TopicPublisher, TopicSubscriber } from "./topics.js";
|
|
3
|
+
import { callService } from "./services.js";
|
|
4
|
+
import { ActionClient } from "./actions.js";
|
|
5
|
+
/**
|
|
6
|
+
* RosTransport adapter that wraps the existing RosbridgeClient.
|
|
7
|
+
*
|
|
8
|
+
* This is the Mode B (Local Network) transport. It connects to a
|
|
9
|
+
* rosbridge_server running on the robot via WebSocket and translates
|
|
10
|
+
* RosTransport method calls into rosbridge protocol messages.
|
|
11
|
+
*/
|
|
12
|
+
export class RosbridgeTransport {
|
|
13
|
+
client;
|
|
14
|
+
actionClient;
|
|
15
|
+
constructor(options) {
|
|
16
|
+
this.client = new RosbridgeClient(options);
|
|
17
|
+
this.actionClient = new ActionClient(this.client);
|
|
18
|
+
}
|
|
19
|
+
async connect() {
|
|
20
|
+
await this.client.connect();
|
|
21
|
+
}
|
|
22
|
+
async disconnect() {
|
|
23
|
+
await this.client.disconnect();
|
|
24
|
+
}
|
|
25
|
+
getStatus() {
|
|
26
|
+
return this.client.getStatus();
|
|
27
|
+
}
|
|
28
|
+
onConnection(handler) {
|
|
29
|
+
return this.client.onConnection(handler);
|
|
30
|
+
}
|
|
31
|
+
advertise(options) {
|
|
32
|
+
this.client.send({
|
|
33
|
+
op: "advertise",
|
|
34
|
+
topic: options.topic,
|
|
35
|
+
type: options.type,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
publish(options) {
|
|
39
|
+
const publisher = new TopicPublisher(this.client, options.topic, options.type);
|
|
40
|
+
publisher.publish(options.msg);
|
|
41
|
+
}
|
|
42
|
+
subscribe(options, handler) {
|
|
43
|
+
const subscriber = new TopicSubscriber(this.client, options.topic, options.type);
|
|
44
|
+
subscriber.subscribe(handler);
|
|
45
|
+
return {
|
|
46
|
+
unsubscribe() {
|
|
47
|
+
subscriber.unsubscribe();
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
async callService(options) {
|
|
52
|
+
const response = await callService(this.client, options.service, options.args, options.type);
|
|
53
|
+
return {
|
|
54
|
+
result: response.result,
|
|
55
|
+
values: response.values,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
async sendActionGoal(options) {
|
|
59
|
+
const response = await this.actionClient.sendGoal({
|
|
60
|
+
action: options.action,
|
|
61
|
+
actionType: options.actionType,
|
|
62
|
+
args: options.args,
|
|
63
|
+
onFeedback: options.onFeedback
|
|
64
|
+
? (feedback) => options.onFeedback(feedback.values)
|
|
65
|
+
: undefined,
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
result: response.result,
|
|
69
|
+
values: response.values,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
async cancelActionGoal(action) {
|
|
73
|
+
await this.actionClient.cancelGoal(action);
|
|
74
|
+
}
|
|
75
|
+
async listTopics() {
|
|
76
|
+
const response = await callService(this.client, "/rosapi/topics", {}, "rosapi/srv/Topics");
|
|
77
|
+
const topics = response.values?.["topics"] ?? [];
|
|
78
|
+
const types = response.values?.["types"] ?? [];
|
|
79
|
+
return topics.map((name, i) => ({ name, type: types[i] ?? "" }));
|
|
80
|
+
}
|
|
81
|
+
async listServices() {
|
|
82
|
+
const response = await callService(this.client, "/rosapi/services", {}, "rosapi/srv/Services");
|
|
83
|
+
const services = response.values?.["services"] ?? [];
|
|
84
|
+
const types = response.values?.["types"] ?? [];
|
|
85
|
+
return services.map((name, i) => ({ name, type: types[i] ?? "" }));
|
|
86
|
+
}
|
|
87
|
+
async listActions() {
|
|
88
|
+
// rosapi has no built-in action listing. Heuristic: action servers expose
|
|
89
|
+
// topics matching */_action/feedback. Extract action names from that pattern.
|
|
90
|
+
const topics = await this.listTopics();
|
|
91
|
+
const actions = [];
|
|
92
|
+
const feedbackSuffix = "/_action/feedback";
|
|
93
|
+
for (const topic of topics) {
|
|
94
|
+
if (topic.name.endsWith(feedbackSuffix)) {
|
|
95
|
+
const actionName = topic.name.slice(0, -feedbackSuffix.length);
|
|
96
|
+
// Feedback type is like "pkg/action/Name_FeedbackMessage"
|
|
97
|
+
// Extract base action type by stripping "_FeedbackMessage" suffix
|
|
98
|
+
let actionType = topic.type;
|
|
99
|
+
if (actionType.endsWith("_FeedbackMessage")) {
|
|
100
|
+
actionType = actionType.slice(0, -"_FeedbackMessage".length);
|
|
101
|
+
}
|
|
102
|
+
actions.push({ name: actionName, type: actionType });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return actions;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/transport/rosbridge/adapter.ts"],"names":[],"mappings":"AAiBA,OAAO,EA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