Skip to content
Erwan Le Huitouze edited this page Sep 3, 2017 · 5 revisions

Install & Build

mkdir -p ~/ros2_java_ws/src

cd ~/ros2_java_ws
wget https://gist.githubusercontent.com/Theosakamg/d9259bbc708c5145255fbdeb25e65e19/raw/ros2_java_desktop.repos
vcs import ~/ros2_java_ws/src < ros2_java_desktop.repos
cd ~/ros2_java_ws/src/ros2/rosidl_typesupport && patch -p1 < ../../ros2_java/ros2_java/rosidl_ros2_java.diff

cd ~/ros2_java_ws
. ~/ament_ws/install_isolated/local_setup.sh
ament build --symlink-install --isolated --skip-packages composition test_communication

Run Build Status

Now you can just run a couple of examples.

Talker and Listener

Talker:

. ~/ament_ws/install_isolated/local_setup.sh
. ~/ros2_java_ws/install_isolated/local_setup.sh
talker_java

Listener:

. ~/ament_ws/install_isolated/local_setup.sh
. ~/ros2_java_ws/install_isolated/local_setup.sh
listener_java

Client and Service

Client:

. ~/ament_ws/install_isolated/local_setup.sh
. ~/ros2_java_ws/install_isolated/local_setup.sh
add_two_ints_client_java

Service:

. ~/ament_ws/install_isolated/local_setup.sh
. ~/ros2_java_ws/install_isolated/local_setup.sh
add_two_ints_service_java

Parameters

Set and Get parameters:

. ~/ament_ws/install_isolated/local_setup.sh
. ~/ros2_java_ws/install_isolated/local_setup.sh
set_and_get_parameters_java

List parameters:

. ~/ament_ws/install_isolated/local_setup.sh
. ~/ros2_java_ws/install_isolated/local_setup.sh
list_parameters_java

You can also combine any scenario where the talker/listener or client/service are written in Java, Python and C++ and they should talk to each other

Test

ament test --symlink-install --isolated