Ask Your Question

what's rosjava mechanism on android?

asked 2013-03-21 00:07:33 -0500

maoqizhen gravatar image

I saw on the Internet that the java library is just a reference to ros package, if on 2 PCs java program can execute corresponding ros nodes, but on android platform , there is no ros node available, how can this be executed. I mean, maybe ros nodes are in C++, and java can just run that on ros, but on android, how can java run these packages?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-03-21 01:43:46 -0500

updated 2013-03-21 13:17:36 -0500

I think the fundamentally, ROSJava and its android derivative are not references to a ros package. They are natively developed in JAVA. ROSJAVA is primarily been developed to allow ros on android devices.

The link above also describes how ROSJAVA nodes work. In android, an activity is the "program", that has a different structure to a cpp program in particular there is no main() function. As a result nodes are classes that run on a NodeMainExecutor Service which allows a main() type of program flow using the onStart method and a cancellable loop. Therefore in one activity you can have multiple nodes running each on their own thread, simply by initialising different classes and launching them on the NodeMainExecutor service.

These nodes, have pretty much all the basic features of normal c++ nodes. The notable exception are any ActionLib functions or types that arent implemented, but which are really only required in some of the more complex higherlevel stacks of ROS. to implement these you may need to write a proxy node in another language that can communicate via a pub or sub to your rosjava node

ROSJAVA also has a selection possible for a newMaster to be launched on application startup which will run a roscore element. This eliminates the need for any roscpp core to be launched. Your nodes will be registered with that core_node.

Hope this helps,

edit flag offensive delete link more


Thanks , I am more clear now

maoqizhen gravatar image maoqizhen  ( 2013-03-21 12:30:33 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-03-21 00:07:33 -0500

Seen: 186 times

Last updated: Mar 21 '13