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-kinetic-catkin ros-kinetic-rospack python-wstool openjdk-8-jdk
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/kinetic/rosjava.rosinstall > source /opt/ros/kinetic/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/kinetic/rosjava_minimal.rosinstall > source /opt/ros/kinetic/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=kinetic-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
Where to now?
You're now ready to start developing a shiny new catkin-rosjava package! Refer to the next tutorial on how to do just that.