Overview
The following instructions show how to build a (mostly) self-contained catkin-ros-java source workspace that can either be extended or used as an underlay by your own sources. |
This installation type is typically only necessary if you are doing catkin-rosjava development at the official stacks level, but also enlightening if trying out various things with rosjava. Note that it wouldn't take much to extend this to a completely self-contained installation, you just need to add a few sources to the rosinstall file. For now, we use rosdep to pull in a few and only include those necessary to build rosjava and generate the core message artifacts.
Prerequisites
Get the basics.
> sudo apt-get install ros-indigo-catkin ros-indigo-rospack python-wstool
You will need JDK 8 for this installation. You can check how to install Open JDK 8 in Ubuntu 14 here.
After installation, set JAVA_HOME environment variable to the root directory of the JVM you just installed; e.g.:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
Sources
Core Sources
The following rosinstaller provides the core rosjava repos, the set of official message artifacts (built via the meta-package generator approach) and repos that support the android application framework.
> mkdir -p ~/rosjava/src > wstool init -j4 ~/rosjava/src https://raw.githubusercontent.com/rosjava/rosjava/indigo/rosjava.rosinstall > source /opt/ros/indigo/setup.bash > cd ~/rosjava # Make sure we've got all rosdeps and msg packages. > rosdep update > rosdep install --from-paths src -i -y > catkin_make
Other Sources
Some other sources that might be of interest:
rosjava_minimal.rosinstall - an alternative minimal installer with few message dependencies and genjava style message generation.
> mkdir -p ~/rosjava_minimal > wstool init -j4 ~/rosjava_minimal/src https://raw.githubusercontent.com/rosjava/rosjava/indigo/rosjava_minimal.rosinstall > source /opt/ros/indigo/setup.bash > cd ~/rosjava_minimal # Make sure we've got all rosdeps and msg packages. > rosdep update > rosdep install --from-paths src -i -y -r # ignore it's complaints about rosjava_messages, we don't use that here > catkin_make
Your Own Sources
You can now proceed to add your own source packages on top, either by merging with the same workspace, e.g.
> cd ~/rosjava/src # Merging a rosinstall set > wstool merge https://raw.githubusercontent.com/me/rosinstalls/master/my_custom_msg_repos.rosinstall # Applying a single repo > wstool set my_custom_msgs --git https://github.com/me/my_custom_msgs --version=indigo-devel # Build > cd ~/rosjava > catkin_make
or by creating an overlay:
> mkdir -p ~/myjava/src > cd ~/myjava/src > wstool init -j4 https://raw.githubusercontent.com/me/rosinstalls/master/my_custom_msg_repos.rosinstall > source ~/rosjava/devel/setup.bash > cd ~/myjava > rosdep update > rosdep install --from-paths src -i -y > catkin_make
You're now ready to start developing a shiny new catkin-rosjava package! Refer to the next tutorial on how to do just that.