Skip to content

Commit a4502f8

Browse files
committed
Correct exmple errors (#1208)
This PR fixes errors in two example files related to ROSIDL parsing and action server functionality. The changes address missing module imports and improve code clarity with better numeric formatting. - Adds missing parser module import in the ROSIDL parse action example - Updates timer interval from BigInt constructor to BigInt literal notation with explanatory comment Fix: #1207
1 parent 41c59a7 commit a4502f8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

example/actions/action_server/action-server-defer-example.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ class FibonacciActionServer {
8383
handleAcceptedCallback(goalHandle) {
8484
this._node.getLogger().info('Deferring execution...');
8585
this._goalHandle = goalHandle;
86-
this._timer = this._node.createTimer(BigInt(3000000), () =>
86+
// Set timeout period to 3s (in nanoseconds).
87+
this._timer = this._node.createTimer(3000000000n, () =>
8788
this.timerCallback()
8889
);
8990
}

example/rosidl/rosidl-parse-action-example.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
const rosInstallPath = process.env.AMENT_PREFIX_PATH;
1616
const packageName = 'test_msgs';
1717
const packagePath = rosInstallPath + '/share/test_msgs/action/Fibonacci.action';
18+
const parser = require('../../rosidl_parser/rosidl_parser.js');
1819

1920
parser
2021
.parseActionFile(packageName, packagePath)

0 commit comments

Comments
 (0)