- Notifications
You must be signed in to change notification settings - Fork1
A ROS system running completely on Java. No ROS installation required. The system includes a Java roscore, a Topic Publisher, a Topic Subscriber, a Service Server and a Service Client.
License
SpyrosKou/Plain-ROS-Java-System-Example
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
ROS Java contains a plain java, standalone version of roscore that does not require any ROS instalation to be present.This is an example ROS system running completely on Java with no ROS instalation required.It is an example that demonstrates running a roscore and four rosjava ROS nodes.A Topic Publisher, a ROS Topic Subscriber, a ROS Service Server and a Service Client.
This example project demonstrates how to do the followingprogrammatically through the ROS Java API:
- Create, start and shutdown the Java roscore
- Create, start and shutdown ROS nodes
- Publish and subscribe to a ROS topic
- Create a ROS Service Server and call it from a ROS Service Client
This repository also provides an example that demonstrates how to run rosjava with an another roscore. E.g. cpp roscore fromROS noetic.
A version of this repository that usescustom ROS messages is availablehere.
In order to compile and run this project only Java needs to be installed.GIT also makes getting the source very easy. Links are provided for convenience.
- GIT , in order to clone theproject repository
- JDK, theproject has been developed and tested usingJDK 17
- Gradle, is used for project compilation. Installing it is not required. Following the instructions below will automatically download gradle 7.5 and ignore any existing installation.
Quick Instructions for WindowsPower Shell
Clone theproject repository:
git clone https://github.com/SpyrosKou/Plain-ROS-Java-System-Example.gitGo into the cloned repository directory:
cd .\Plain-ROS-Java-System-Example\Compile the project and prepare for running:
gradlew installDistRun the project using the generated script:
.\build\install\Plain-ROS-Java-System-Example\bin\Plain-ROS-Java-System-Example.batBuild and run in a single command using thegradle application plugin:
gradlew run
Clone theproject repository:
git clone https://github.com/SpyrosKou/Plain-ROS-Java-System-Example.gitGo into the cloned repository directory:
cd Plain-ROS-Java-System-Example/Add execute permission to gradlew script:
sudo chmod +x gradlewCompile the project and install it locally:
gradlew installDistRun the project using the generated script:
./build/install/Plain-ROS-Java-System-Example/bin/Plain-ROS-Java-System-ExampleBuild and run in a single command using using thegradle application plugin:
gradlew run
It is possible to use rosjava to run rosjava nodes in an environment where a ros system is already running. E.g. a cpp noetic ros instance.An example on how to run rosjava nodes programmatically without starting roscore is provided inMainExternalNote that if a roscore is not running, then this example will not run correctly.In order to use it do the following:
Set
ROS_MASTER_URIandROS_IPenvironment variables. Both these variables are needed. If these environment variables are missing, you will see some errors in step 4 below.The following commands assumes the example and roscore run in127.0.0.1akalocalhost.export ROS_MASTER_URI=http://127.0.0.1:11311export ROS_IP=http://127.0.0.1:11311Start roscoreRun the following:
roscoreWith the roscore already started externaly runMainExternal
You can start directly theMainExternal from the gradle by running:
./gradlew runWithExternalRos
About
A ROS system running completely on Java. No ROS installation required. The system includes a Java roscore, a Topic Publisher, a Topic Subscriber, a Service Server and a Service Client.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.