Skip to content

Commit 3543412

Browse files
committed
Fixed bug on timestamp publication for sync channel
1 parent 1b0793c commit 3543412

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

mocha_core/mocha_core/synchronize_channel.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,8 @@ def execute(self, userdata):
224224
if answer is not None:
225225
# We received an ACK
226226
if self.outer.client_sync_complete_pub is not None:
227-
time_msg = Time()
228227
current_time = self.outer.ros_node.get_clock().now()
229-
time_msg.sec, time_msg.nanosec = current_time.seconds_nanoseconds()
230-
self.outer.client_sync_complete_pub.publish(time_msg)
228+
self.outer.client_sync_complete_pub.publish(current_time.to_msg())
231229
break
232230
time.sleep(CHECK_POLL_TIME)
233231
i += 1
@@ -482,9 +480,7 @@ def callback_server(self, msg):
482480
f" Target: {target.decode()} - " +
483481
f"My target: {self.target_robot}")
484482
if self.server_sync_complete_pub is not None:
485-
time_msg = Time()
486483
current_time = self.ros_node.get_clock().now()
487-
time_msg.sec, time_msg.nanosec = current_time.seconds_nanoseconds()
488-
self.server_sync_complete_pub.publish(time_msg)
484+
self.server_sync_complete_pub.publish(current_time.to_msg())
489485
return "Ack".encode()
490486
return Comm_msgs.SERRM.name.encode()

0 commit comments

Comments
 (0)