Skip to content

Commit 33bc005

Browse files
committed
Address comments
1 parent b9a0540 commit 33bc005

2 files changed

Lines changed: 2 additions & 49 deletions

File tree

lib/action/client.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -118,29 +118,6 @@ class ActionClient extends Entity {
118118
this.qos.statusSubQosProfile
119119
);
120120

121-
// Probe that the RMW actually supports content filtering before enabling
122-
// the optimization. If the RMW does not support content filtering, the
123-
// rcl layer returns RCL_RET_UNSUPPORTED which disables the optimization
124-
// gracefully. However, probing upfront avoids the warning log on first use.
125-
if (this._enableFeedbackMsgOptimization) {
126-
try {
127-
const probeSub = node.createSubscription(
128-
this._typeClass.impl.FeedbackMessage,
129-
actionName + '/_action/feedback',
130-
() => {}
131-
);
132-
const supported =
133-
typeof probeSub.isContentFilterSupported === 'function' &&
134-
probeSub.isContentFilterSupported();
135-
node.destroySubscription(probeSub);
136-
if (!supported) {
137-
this._enableFeedbackMsgOptimization = false;
138-
}
139-
} catch {
140-
this._enableFeedbackMsgOptimization = false;
141-
}
142-
}
143-
144121
node._addActionClient(this);
145122
}
146123

test/test-action-client.js

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -321,30 +321,6 @@ describe('rclnodejs action client', function () {
321321
typeof nativeLoader.actionConfigureFeedbackSubFilterAddGoalId ===
322322
'function';
323323

324-
// Probe whether the RMW supports content filtering, matching the
325-
// same check the ActionClient constructor performs.
326-
let isContentFilterSupported = false;
327-
beforeEach(function () {
328-
if (isContentFilterSupported) return; // only probe once
329-
if (isFeedbackFilterSupported()) {
330-
try {
331-
const loader = require('../lib/interface_loader.js');
332-
const typeClass = loader.loadInterface(fibonacci);
333-
const probeSub = node.createSubscription(
334-
typeClass.impl.FeedbackMessage,
335-
'fibonacci/_action/feedback',
336-
() => {}
337-
);
338-
isContentFilterSupported =
339-
typeof probeSub.isContentFilterSupported === 'function' &&
340-
probeSub.isContentFilterSupported();
341-
node.destroySubscription(probeSub);
342-
} catch {
343-
isContentFilterSupported = false;
344-
}
345-
}
346-
});
347-
348324
it('Test option defaults to false', function () {
349325
let client = new rclnodejs.ActionClient(node, fibonacci, 'fibonacci');
350326
assert.strictEqual(client._enableFeedbackMsgOptimization, false);
@@ -355,8 +331,8 @@ describe('rclnodejs action client', function () {
355331
let client = new rclnodejs.ActionClient(node, fibonacci, 'fibonacci', {
356332
enableFeedbackMsgOptimization: true,
357333
});
358-
// Only enabled when native API exists AND the RMW supports content filtering
359-
if (isFeedbackFilterSupported() && isContentFilterSupported) {
334+
// Only enabled when native API exists
335+
if (isFeedbackFilterSupported()) {
360336
assert.strictEqual(client._enableFeedbackMsgOptimization, true);
361337
} else {
362338
assert.strictEqual(client._enableFeedbackMsgOptimization, false);

0 commit comments

Comments
 (0)