Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rosjava Core Gradle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CeTI
ROS
ROS Java Packages
Rosjava Core Gradle
Commits
0227a76e
Commit
0227a76e
authored
Apr 23, 2012
by
Damon Kohler
Browse files
Options
Downloads
Patches
Plain Diff
Added PublisherListener example to documentation.
parent
52fb1b23
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/src/main/sphinx/advanced.rst
+23
-1
23 additions, 1 deletion
docs/src/main/sphinx/advanced.rst
with
23 additions
and
1 deletion
docs/src/main/sphinx/advanced.rst
+
23
−
1
View file @
0227a76e
Advanced topics
===============
Listeners
---------
Because rosjava provides a primarily asynchronous API, many classes which allow
you to provide event listeners. For example,
:javadoc:`org.ros.node.topic.PublisherListener`\s allow you to react to
lifecycle events of a :javadoc:`org.ros.node.topic.Publisher`. The snippet
below adds a :javadoc:`org.ros.node.topic.PublisherListener` that will log a
warning message if the :javadoc:`org.ros.node.topic.Publisher` fails to
register with the master. ::
Node node;
Publisher<std_msgs.String> publisher;
...
publisher.addListener(new DefaultPublisherListener() {
@Override
public void onMasterRegistrationFailure(Publisher<std_msgs.String> registrant) {
node.getLog().warn("Publisher failed to register: " + registrant);
}
});
Messages as BLOBs
-----------------
...
...
@@ -20,4 +43,3 @@ little endian. ::
.newMessageDeserializer(sensor_msgs.PointCloud._TYPE)
.deserialize(buffer);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment