RosJava + Raspberry PI + Eclipse

asked 2015-04-15 17:29:10 -0600

francesco.dibenedetto-db90 gravatar image

Hi guys,

I start saying that i haven't experience with ROS, i just start learning it... so my question probably will be NOOB but i hope someone will help me, at the moment i'm stuck. :)

This is the scenario:

My professor give me a Raspberry PI with ROS indigo installed plus some custom packages. The install directory of ROS is /opt/ros/indigo/ . I would like to work in this already configured environment writing Java programs that use a specific framework (JADE) i use Eclipse to develop my projects. I readed that is possible to archive the same functionality of the client library -RosPy and RosCpp- using RosJava.

I would like to call object which interface with ROS functionality [the custom packages that are alredy available to me in the ROS build installed on the Raspberry] (PUB/SUB architecture) from a Java class, so from what i understood, i need to create a class that extends AbstractNodeMain and use the functions as the tutorial shows.

First question: is possible to archive this result without creating a specific ROS package? That is equivalent to say: import a JAR in my project and use it like a library in a bigger Java program. If not which would be the workflow?

However i started to download the RosJava files from the repository using the commands:

git clone https://github.com/rosjava/rosjava_core

cd rosjava_core

git checkout -b indigo origin/indigo

Then i tried to build the Eclipse project to be imported in eclipse. If i'm correct the command should create a project structure that fits perfectly with the format used by Eclipse, so i did:

./gradlew eclipse

The processed ended, but no visible output or project structure was created in the rosjava_core directory.

Second question: where the output goes when the 'build' project finishes?

Now assuming that i have a project structure, i should import it in Eclipse and start to write my code.

Third question: How i can integrate this code in the ROS environment? How ROS manage the dependencies? Should I create the project with instrument called Catkin or need i to set some Environment variable that point to my project?

Sorry for the long post, but i'm very confused on the topic. I really hope that someone will explain the situation better.


Last reflexion:

Maybe i can call ROS functionality (setting and getting data from some already made Nodes) not from RosJava, but using another tool called RosBridge. As far i understood this tool let a non-ROS program to interface, using a websocket, with the ROS environment. Maybe this could be a solution, so install rosbridge, open a websocket and create a webclient in Java to communicate with the already running node in the setted-up ROS environment.

Could this work? or are there some limitations?

Thanks a lot!

Francesco

edit retag flag offensive close merge delete