This repository has been archived by the owner on Aug 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from adamantivm/kinetic-updates
Updates for Kinetic release
- Loading branch information
Showing
8 changed files
with
184 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters