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

Rename rosjava_tutorial_pubsub java package according to best practices.

Add documentation about executing nodes.
parent 0a3e039b
Branches
Tags
No related merge requests found
...@@ -151,14 +151,40 @@ automatically when the :javadoc:`org.ros.node.Node` exits. ...@@ -151,14 +151,40 @@ automatically when the :javadoc:`org.ros.node.Node` exits.
Executing nodes Executing nodes
--------------- ---------------
When packaging your application into jar, you can use :javadoc:`org.ros.RosRun`
as the main class. :javadoc:`org.ros.RosRun` provides a
:javadoc:`org.ros.node.NodeMainExecutor` and a command line interface that will
be familiar to ROS veterans. For example, the following steps will build and
execute the :javadoc:`org.ros.rosjava_tutorial_pubsub.Talker` and
:javadoc:`org.ros.rosjava_tutorial_pubsub.Listener` nodes in separate
processes:
#. roscd rosjava_tutorial_pubsub
#. ../gradlew installApp
#. roscore &
#. ./build/rosjava_tutorial_pubsub/bin/rosjava_tutorial_pubsub org.ros.rosjava_tutorial_pubsub.Talker &
#. ./build/rosjava_tutorial_pubsub/bin/rosjava_tutorial_pubsub org.ros.rosjava_tutorial_pubsub.Listener
.. note:: The above example launches roscore and the Talker node in the background. You could instead launch each in a separate terminal.
.. note:: You may notice that rosrun cannot find the installed executable. This is a known issue that will be addressed in the future.
At this point, you should see the familiar "Hello, world!" messages start
appearing in your terminal. You can configure the executed nodes from the
command line in the same way you would any other ROS executable. For example,
the following commands will remap the default topic /chatter to /foo.
#. ./build/rosjava_tutorial_pubsub/bin/rosjava_tutorial_pubsub org.ros.rosjava_tutorial_pubsub.Talker chatter:=/foo &
#. ./build/rosjava_tutorial_pubsub/bin/rosjava_tutorial_pubsub org.ros.rosjava_tutorial_pubsub.Listener chatter:=/foo
See :roswiki:`Remapping%20Arguments` for more information.
As with all ROS nodes, rosjava nodes must connect to a :roswiki:`Master` in As with all ROS nodes, rosjava nodes must connect to a :roswiki:`Master` in
order to function. However, unlike other client library implementations, order to function. However, unlike other client library implementations,
rosjava also provides its own :javadoc:`org.ros.RosCore` implementation. This rosjava also provides its own :javadoc:`org.ros.RosCore` implementation. This
enables ROS to function in a pure Java installation. For example, you can enables ROS to function in a pure Java installation. For example, you can
operate a complete ROS graph on a stock (i.e. non-rooted) Android phone. operate a complete ROS graph on a stock (i.e. non-rooted) Android phone.
See :javadoc:`org.ros.RosRun` and the ``rosjava_tutorial_pubsub`` package.
Messages Messages
-------- --------
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* the License. * the License.
*/ */
package org.ros.tutorials.pubsub; package org.ros.rosjava_tutorial_pubsub;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.ros.message.MessageListener; import org.ros.message.MessageListener;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* the License. * the License.
*/ */
package org.ros.tutorials.pubsub; package org.ros.rosjava_tutorial_pubsub;
import org.ros.concurrent.CancellableLoop; import org.ros.concurrent.CancellableLoop;
import org.ros.namespace.GraphName; import org.ros.namespace.GraphName;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment