diff --git a/rcljava/src/main/java/org/ros2/rcljava/node/Node.java b/rcljava/src/main/java/org/ros2/rcljava/node/Node.java index 0a3ba7ad..c5c034a7 100644 --- a/rcljava/src/main/java/org/ros2/rcljava/node/Node.java +++ b/rcljava/src/main/java/org/ros2/rcljava/node/Node.java @@ -33,6 +33,7 @@ import org.ros2.rcljava.service.RMWRequestId; import org.ros2.rcljava.service.Service; import org.ros2.rcljava.subscription.Subscription; +import org.ros2.rcljava.time.Clock; import org.ros2.rcljava.timer.Timer; import org.ros2.rcljava.timer.WallTimer; @@ -41,6 +42,11 @@ * A Node must be created via @{link RCLJava#createNode(String)} */ public interface Node extends Disposable { + /** + * @return The nodes @{link Clock}. + */ + Clock getClock(); + /** * return All the @{link Client}s that have been created by this instance. */ diff --git a/rcljava/src/main/java/org/ros2/rcljava/node/NodeImpl.java b/rcljava/src/main/java/org/ros2/rcljava/node/NodeImpl.java index 9fdc1c27..c8af8640 100644 --- a/rcljava/src/main/java/org/ros2/rcljava/node/NodeImpl.java +++ b/rcljava/src/main/java/org/ros2/rcljava/node/NodeImpl.java @@ -176,6 +176,13 @@ private static native long nativeCreatePublisherHa private static native long nativeCreateSubscriptionHandle( long handle, Class messageType, String topic, long qosProfileHandle); + /** + * {@inheritDoc} + */ + public final Clock getClock() { + return this.clock; + } + /** * {@inheritDoc} */