Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #225 from adamantivm/kinetic-updates
Browse files Browse the repository at this point in the history
Updates for Kinetic release
  • Loading branch information
adamantivm authored Dec 18, 2016
2 parents 389b657 + 6274b19 commit 13d03b6
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog
=========

0.3.0 (2016-12-13)
------------------
* Updates for Kinetic release.
* NativeNodeMain for C++ node integration.

0.2.1 (2015-02-25)
------------------
* allow setting of the talker topic name in pubsub tutorial.
Expand Down
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
rosjava is the first pure Java implementation of ROS.

From [ROS.org](http://www.ros.org/wiki/): ROS is an open-source, meta-operating
system for your robot. It provides the services you would expect from an
operating system, including hardware abstraction, low-level device control,
implementation of commonly-used functionality, message-passing between
processes, and package management.

Developed at Google in cooperation with Willow Garage, rosjava enables
integration of Android and ROS compatible robots. This project is under active
development and currently alpha quality software. Please report bugs and feature
requests on the [issues
list](https://github.com/rosjava/rosjava/issues?state=open).

To get started, visit the
[rosjava_core](http://rosjava.github.com/rosjava_core/latest) and
[android_core](http://rosjava.github.com/android_core/latest) pages for
documentation concerning the core libraries and examples. Also visit the roswiki
[rosjava](http://wiki.ros.org/rosjava) and
[android](http://wiki.ros.org/android) pages for more general rosjava-android
information.

Still have questions? Check out the ros-users [discussion
list](https://discourse.ros.org/c/rosjava), post questions to [ROS
Answers](http://answers.ros.org/questions/) with the tag "rosjava," or join #ROS
on irc.oftc.net.

rosjava was announced publicly during the [Cloud Robotics tech talk at Google
I/O 2011](http://www.youtube.com/watch?feature=player_embedded&v=FxXBUp-4800).

Looking for a robot platform to experiment with ROS, Android, and cloud
robotics? The [OSRF](http://www.osrfoundation.org/)
[TurtleBot](http://wiki.ros.org/Robots/TurtleBot) is a great mobile perception
platform for [getting started with robotics
development](http://www.youtube.com/watch?feature=player_embedded&v=MOEjL8JDvd0).

### Branches ###

The master branch reflects the latest version of rosjava. All development
happens on the master branch in the form of pull requests from developers.
Unless you are developing rosjava itself, you should _not_ use the master
branch.

Named branches are created whenever a new version of ROS is released. These
branches are considered stable. No new features will be added to these branches,
however, bug fixes may be cherry picked from master.

### Pull Requests ###

You must sign a Contributor License Agreement (CLA) before we can accept any
code. The CLA protects you and us.

* If you are an individual writing original source code and you're sure you own
the intellectual property, then you'll need to sign an [individual
CLA](https://developers.google.com/open-source/cla/individual).
* If you work for a company that wants to allow you to contribute your work to
SL4A, then you'll need to sign a [corporate
CLA](https://developers.google.com/open-source/cla/corporate).

Follow either of the two links above to access the appropriate CLA and
instructions for how to sign and return it. Damon will respond on either github
or email to confirm.
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ task wrapper(type: Wrapper) {
}

buildscript {
apply from: "https://github.com/rosjava/rosjava_bootstrap/raw/indigo/buildscript.gradle"
apply from: "https://github.com/rosjava/rosjava_bootstrap/raw/kinetic/buildscript.gradle"
}

apply plugin: "catkin"
Expand All @@ -31,16 +31,16 @@ allprojects {

subprojects {
if (name != 'docs') {
/*
/*
* The ros plugin configures a few things:
*
*
* - local deployment repository : where it dumps the jars and packaged artifacts)
* - local maven repositories : where it finds your locally installed/built artifacts)
* - local maven repositories : where it finds your locally installed/built artifacts)
* - external maven repositories : where it goes looking if it can't find dependencies locally
*
*
* To modify, or add repos to the default external maven repositories list, pull request against this code:
*
* https://github.com/rosjava/rosjava_bootstrap/blob/indigo/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosPlugin.groovy#L31
*
* https://github.com/rosjava/rosjava_bootstrap/blob/kinetic/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosPlugin.groovy#L31
*/
apply plugin: "ros-java"
apply plugin: "osgi"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ you simply need to clone the github repository
git clone https://github.com/rosjava/rosjava_core
cd rosjava_core
git checkout -b indigo origin/indigo
git checkout -b kinetic origin/kinetic
and proceed immediately to the section on :ref:`building`.

Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package>
<name>rosjava_core</name>
<version>0.2.1</version>
<version>0.3.0</version>
<description>
An implementation of ROS in pure-Java with Android support.
</description>
Expand Down
8 changes: 4 additions & 4 deletions rosjava/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ dependencies {
compile project(':apache_xmlrpc_common')
compile project(':apache_xmlrpc_server')
compile project(':apache_xmlrpc_client')
compile 'org.ros.rosjava_bootstrap:message_generation:[0.2,0.3)'
compile 'org.ros.rosjava_messages:rosjava_test_msgs:[0.2,0.3)'
compile 'org.ros.rosjava_bootstrap:message_generation:[0.3,0.4)'
compile 'org.ros.rosjava_messages:rosjava_test_msgs:[0.3,0.4)'
compile 'org.ros.rosjava_messages:rosgraph_msgs:[1.11,1.12)'
compile 'org.ros.rosjava_messages:geometry_msgs:[1.11,1.12)'
compile 'org.ros.rosjava_messages:nav_msgs:[1.11,1.12)'
compile 'org.ros.rosjava_messages:geometry_msgs:[1.12,1.13)'
compile 'org.ros.rosjava_messages:nav_msgs:[1.12,1.13)'
compile 'org.ros.rosjava_messages:tf2_msgs:[0.5,0.6)'
compile 'dnsjava:dnsjava:2.1.1'
compile 'org.apache.commons:com.springsource.org.apache.commons.logging:1.1.1'
Expand Down
103 changes: 103 additions & 0 deletions rosjava/src/main/java/org/ros/node/NativeNodeMain.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package org.ros.node;

import org.ros.node.AbstractNodeMain;
import org.ros.node.ConnectedNode;
import org.ros.node.Node;
import org.ros.namespace.GraphName;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.List;
import java.util.Map;

/**
* A java wrapper to load and run a native-code ROS node.
*
* Note: there are no actual native methods declared in this class. We only define an interface. The native methods should be declared in the child class.
*
* @author [email protected] (Ernesto Corbellini)
*/
public abstract class NativeNodeMain extends AbstractNodeMain {

private Log log = LogFactory.getLog(NativeNodeMain.class);
private String libName;
private String masterUri = null;
private String hostName = null;
private String nodeName = null;
private String[] remappingArguments;
private boolean shuttingDown = false;

/**
* @param libName
* The name of the library to load.
*
* @param remappings
* A string array with ROS argument remapping pairs in each element.
**/
public NativeNodeMain(String libName, String[] remappings) {
this.libName = libName;

// if no remapping is needed, create an empty array
if (remappings == null) {
remappingArguments = new String[0];
}

log.info("Trying to load native library '" + libName + "'...");
try
{
System.loadLibrary(libName);
}
catch (SecurityException e)
{
log.info("Error loading library! SecurityException");
}
catch (UnsatisfiedLinkError e)
{
log.info("Error loading library! UnsatisfiedLinkError");
}
catch (NullPointerException e)
{
log.info("Error loading library! NullPointerException");
}
}

/**
* @param libName
* The name of the library to load.
**/
public NativeNodeMain(String libName) {
this(libName, null);
}

// These methods define the execution model interface for this node.
protected abstract void execute(String rosMasterUri, String rosHostName, String rosNodeName, String[] remappingArguments);
protected abstract void shutdown();

@Override
public void onStart(final ConnectedNode connectedNode) {
// retain important ROS info
masterUri = connectedNode.getMasterUri().toString();
hostName = connectedNode.getUri().getHost();
nodeName = this.libName;

// create a new thread to execute the native code.
new Thread() {
@Override
public void run() {
execute(masterUri, hostName, nodeName, remappingArguments);

// node execution has finished so we propagate the shutdown sequence only if we aren't already shutting down for other reasons
if(!shuttingDown) {
connectedNode.shutdown();
}
}
}.start();
}

@Override
public void onShutdown(Node node) {
shuttingDown = true;
shutdown();
}
}
2 changes: 1 addition & 1 deletion rosjava_tutorial_right_hand_rule/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ mainClassName = 'org.ros.RosRun'

dependencies {
compile project(':rosjava')
compile 'org.ros.rosjava_messages:sensor_msgs:[1.11,1.12)'
compile 'org.ros.rosjava_messages:sensor_msgs:[1.12,1.13)'
}

0 comments on commit 13d03b6

Please sign in to comment.