Skip to content
Snippets Groups Projects
Commit 42262dab authored by Damon Kohler's avatar Damon Kohler
Browse files

Update documentation.

parent 0227a76e
No related branches found
No related tags found
No related merge requests found
...@@ -25,11 +25,15 @@ needs_sphinx = '1.0' ...@@ -25,11 +25,15 @@ needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions # Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['javadoc', 'ros'] extensions = ['sphinx.ext.intersphinx', 'javadoc', 'ros']
intersphinx_mapping = {
'android-core': ('http://docs.rosjava.googlecode.com/hg/android_core/html/', None),
}
javadoc_root = 'javadoc' javadoc_root = 'javadoc'
# Add any paths that contain templates here, relative to this directory. # Ad any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
# The suffix of source filenames. # The suffix of source filenames.
......
...@@ -140,8 +140,10 @@ you're a ROS veteran. The :javadoc:`org.ros.topic.Publisher` publishes ...@@ -140,8 +140,10 @@ you're a ROS veteran. The :javadoc:`org.ros.topic.Publisher` publishes
.. literalinclude:: ../../../../rosjava_tutorial_pubsub/src/main/java/org/ros/rosjava_tutorial_pubsub/Talker.java .. literalinclude:: ../../../../rosjava_tutorial_pubsub/src/main/java/org/ros/rosjava_tutorial_pubsub/Talker.java
:language: java :language: java
:linenos: :linenos:
:lines: 17-
:emphasize-lines: 27,37
Line 43 will probably feel unfamailiar even to ROS veterans. This is one Line 27 will probably feel unfamailiar even to ROS veterans. This is one
example of rosjava's asynchornous API. The intent of our example of rosjava's asynchornous API. The intent of our
:javadoc:`org.ros.rosjava_tutorial_pubsub.Talker` class is to publish a hello :javadoc:`org.ros.rosjava_tutorial_pubsub.Talker` class is to publish a hello
world message to anyone who will listen once per second. One way to accomplish world message to anyone who will listen once per second. One way to accomplish
...@@ -151,7 +153,7 @@ method. So, we create a :javadoc:`org.ros.concurrent.CancellableLoop` and ask ...@@ -151,7 +153,7 @@ method. So, we create a :javadoc:`org.ros.concurrent.CancellableLoop` and ask
the :javadoc:`org.ros.node.Node` to execute it. The loop will be interrupted the :javadoc:`org.ros.node.Node` to execute it. The loop will be interrupted
automatically when the :javadoc:`org.ros.node.Node` exits. automatically when the :javadoc:`org.ros.node.Node` exits.
On line 53 we create a new ``std_msgs.String`` message to publish using the On line 37 we create a new ``std_msgs.String`` message to publish using the
:javadoc:`org.ros.node.topic.Publisher#newMessage()` method. Messages in :javadoc:`org.ros.node.topic.Publisher#newMessage()` method. Messages in
rosjava cannot be instantiated directly. More on that later. rosjava cannot be instantiated directly. More on that later.
...@@ -161,8 +163,10 @@ class. ...@@ -161,8 +163,10 @@ class.
.. literalinclude:: ../../../../rosjava_tutorial_pubsub/src/main/java/org/ros/rosjava_tutorial_pubsub/Listener.java .. literalinclude:: ../../../../rosjava_tutorial_pubsub/src/main/java/org/ros/rosjava_tutorial_pubsub/Listener.java
:language: java :language: java
:linenos: :linenos:
:lines: 17-
:emphasize-lines: 26
In line 42 we see another example of rosjava's asynchornous API. We can add as In line 26 we see another example of rosjava's asynchornous API. We can add as
many :javadoc:`org.ros.message.MessageListener`\s to our many :javadoc:`org.ros.message.MessageListener`\s to our
:javadoc:`org.ros.node.topic.Subscriber` as we like. When a new message is :javadoc:`org.ros.node.topic.Subscriber` as we like. When a new message is
received, all of our :javadoc:`org.ros.message.MessageListener`\s will be received, all of our :javadoc:`org.ros.message.MessageListener`\s will be
...@@ -229,9 +233,11 @@ a ROS veteran. ...@@ -229,9 +233,11 @@ a ROS veteran.
.. literalinclude:: ../../../../rosjava_tutorial_services/src/main/java/org/ros/rosjava_tutorial_services/Server.java .. literalinclude:: ../../../../rosjava_tutorial_services/src/main/java/org/ros/rosjava_tutorial_services/Server.java
:language: java :language: java
:linenos: :linenos:
:lines: 17-
:emphasize-lines: 28
The :javadoc:`org.ros.node.service.ServiceResponseBuilder` is called The :javadoc:`org.ros.node.service.ServiceResponseBuilder` is called
asynchronously for each incoming request. On line 44 we modify the response asynchronously for each incoming request. On line 28 we modify the response
output parameter to contain the sum of the two integers in the request. The output parameter to contain the sum of the two integers in the request. The
response will be sent once the response will be sent once the
:javadoc:`org.ros.node.service.ServiceResponseBuilder#build(T, S)` returns. :javadoc:`org.ros.node.service.ServiceResponseBuilder#build(T, S)` returns.
...@@ -242,14 +248,16 @@ class. ...@@ -242,14 +248,16 @@ class.
.. literalinclude:: ../../../../rosjava_tutorial_services/src/main/java/org/ros/rosjava_tutorial_services/Client.java .. literalinclude:: ../../../../rosjava_tutorial_services/src/main/java/org/ros/rosjava_tutorial_services/Client.java
:language: java :language: java
:linenos: :linenos:
:lines: 17-
In line 51 we see another example of rosjava's asynchornous API. When the response is :emphasize-lines: 35-46
received, our :javadoc:`org.ros.node.service.ServiceResponseListener` will be
called with the incoming response as an argument to On lines 35-46 we see another example of rosjava's asynchornous API. When the
:javadoc:`org.ros.node.service.ServiceResponseListener#onSuccess(T)`. response is received, our
:javadoc:`org.ros.node.service.ServiceResponseListener` will be called with the
In the event that the server thows a incoming response as an argument to
:javadoc:`org.ros.exception.ServiceException` while building the response, :javadoc:`org.ros.node.service.ServiceResponseListener#onSuccess(T)`. In the
event that the server thows a :javadoc:`org.ros.exception.ServiceException`
while building the response,
:javadoc:`org.ros.node.service.ServiceResponseListener#onFailure(RemoteException)` :javadoc:`org.ros.node.service.ServiceResponseListener#onFailure(RemoteException)`
will be called. The :javadoc:`org.ros.exception.RemoteException` will contain will be called. The :javadoc:`org.ros.exception.RemoteException` will contain
the error message from the server. the error message from the server.
......
...@@ -7,7 +7,12 @@ development. Consider all APIs and documentation to be volatile. ...@@ -7,7 +7,12 @@ development. Consider all APIs and documentation to be volatile.
`Javadoc <javadoc/index.html>`_ is used extensively and cross referenced from `Javadoc <javadoc/index.html>`_ is used extensively and cross referenced from
this documentation. this documentation.
Note that package level documentation is in progress. Android friendly
----------------
One of the primary goals of rosjava is to bring ROS to Android. See the
android_core :ref:`android-core:getting-started` documentation for more
information.
Asynchronous Asynchronous
------------ ------------
...@@ -16,9 +21,12 @@ Because ROS is heavily dependent on network communication, rosjava is ...@@ -16,9 +21,12 @@ Because ROS is heavily dependent on network communication, rosjava is
asynchronous. No attempt is made to hide asynchronous behavior behind a asynchronous. No attempt is made to hide asynchronous behavior behind a
synchronous API. As a result, the rosjava APIs may feel unfamiliar. synchronous API. As a result, the rosjava APIs may feel unfamiliar.
First, you will not find a ``spin()`` method. Unlike other client libraries, More threads, fewer processes
many rosjava nodes can run in a thread pool within a single JVM process. In -----------------------------
this way, rosjava nodes are similar to C++ nodlets. In the future, rosjava
nodes will support in memory communication in the same way that C++ nodelets do You will not find a ``spin()`` method in rosjav in rosjava. Unlike other client
today. libraries, many rosjava nodes can run in a thread pool within a single JVM
process. In this way, rosjava nodes are similar to C++ nodlets. In the future,
rosjava nodes will support in memory communication in the same way that C++
nodelets do today.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment