-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Labels
Description
Description
- Library Version: rclnodejs 1.8.1 (regression)
- Previously working Version: rclnodejs 0.21.4
- ROS Version: ROS2 Humble
- Platform / OS: Ubuntu 22.04
Steps To Reproduce
import * as rclnodejs from 'rclnodejs';
let lastTs: number;
rclnodejs.init().then(() => {
const node = new rclnodejs.Node('test_node');
node.createSubscription(
'std_msgs/msg/Float64MultiArray',
'/map_to_base_link_pose2d',
(msg: any) => {
const now = Date.now();
if (lastTs) {
console.log('Raw Hz:', (1000 / (now - lastTs)).toFixed(2));
}
lastTs = now;
}
);
rclnodejs.spin(node);
});Expected Behavior
NodeJS subscription should receive messages at ~10Hz, matching the ROS2 topic publishing rate.
Actual Behavior
NodeJS subscription receives callbacks at ~1.5–1.8Hz.
Messages appear delayed or dropped, despite ROS2 publishing at 10Hz.
Regression compared to rclnodejs 0.21.4.
Workarounds like setImmediate() do not fix the problem.
Additional Notes / Observations
This issue only appears in rclnodejs 1.8.1.
High-frequency topics are significantly affected; lower-frequency topics (~1–2Hz) are unaffected.
Likely related to the NodeJS event loop integration or the subscription dispatch mechanism in the new version.
Reactions are currently unavailable