Skip to content

Commit 047cafc

Browse files
wayneparrottMinggang Wang
authored andcommitted
Changed TimeSource subscription to use topic /clock.
Fix #696
1 parent 57859e6 commit 047cafc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/time_source.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const { Parameter, ParameterType } = require('./parameter.js');
2222
const Time = require('./time.js');
2323

2424
const USE_SIM_TIME_PARAM = 'use_sim_time';
25-
const CLOCK_TOPIC = 'clock';
25+
const CLOCK_TOPIC = '/clock';
2626

2727
/**
2828
* @class - Class representing a TimeSource in ROS

test/test-time-source.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('rclnodejs TimeSource testing', function() {
5151
});
5252

5353
function publishClockMessage(node) {
54-
let pub = node.createPublisher('builtin_interfaces/msg/Time', 'clock');
54+
let pub = node.createPublisher('builtin_interfaces/msg/Time', '/clock');
5555
let count = 0;
5656
timer = setInterval(() => {
5757
pub.publish({ sec: count, nanosec: 0 });

0 commit comments

Comments
 (0)