Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getClock method to Node interface #139

Open
wants to merge 1 commit into
base: dashing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions rcljava/src/main/java/org/ros2/rcljava/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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.
*/
Expand Down
7 changes: 7 additions & 0 deletions rcljava/src/main/java/org/ros2/rcljava/node/NodeImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ private static native <T extends MessageDefinition> long nativeCreatePublisherHa
private static native <T extends MessageDefinition> long nativeCreateSubscriptionHandle(
long handle, Class<T> messageType, String topic, long qosProfileHandle);

/**
* {@inheritDoc}
*/
public final Clock getClock() {
return this.clock;
}

/**
* {@inheritDoc}
*/
Expand Down