Skip to content

Commit 960f896

Browse files
authored
Merge pull request #187 from ros2-java/galactic_update
Galactic update
2 parents 2ac6f6c + 610299c commit 960f896

23 files changed

+231
-280
lines changed

.github/workflows/build_and_test.yml

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,54 @@ on: [push, pull_request]
44

55
jobs:
66
build_and_test:
7-
runs-on: ubuntu-18.04
7+
runs-on: ubuntu-20.04
88
steps:
99
- name: Install Java
1010
run: |
1111
sudo apt-get update -qq
1212
sudo apt-get install -y default-jdk gradle
1313
- uses: actions/checkout@v2
14-
- uses: ros-tooling/setup-ros@0.2.1
14+
- uses: ros-tooling/setup-ros@v0.2
1515
with:
16-
required-ros-distributions: dashing
16+
required-ros-distributions: galactic
1717
- uses: ros-tooling/action-ros-ci@v0.2
1818
with:
1919
package-name: rosidl_generator_java rcljava_common rcljava
20-
target-ros2-distro: dashing
20+
target-ros2-distro: galactic
2121
vcs-repo-file-url: ${{ github.workspace }}/ros2_java_desktop.repos
2222

2323
build_android:
24-
runs-on: ubuntu-18.04
24+
runs-on: ubuntu-20.04
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
include:
29+
- colcon_meta: |
30+
{
31+
"names": {
32+
"rcl": {
33+
"cmake-args": [ "-DBUILD_TESTING=OFF" ]
34+
},
35+
"rcl_yaml_param_parser": {
36+
"cmake-args": [ "-DBUILD_TESTING=OFF" ]
37+
},
38+
"rclcpp": {
39+
"cmake-args": [ "-DBUILD_TESTING=OFF" ]
40+
},
41+
"rclcpp_action": {
42+
"cmake-args": [ "-DBUILD_TESTING=OFF" ]
43+
},
44+
"rclcpp_lifecycle": {
45+
"cmake-args": [ "-DBUILD_TESTING=OFF" ]
46+
},
47+
"rcutils": {
48+
"cmake-args": [ "-DBUILD_TESTING=OFF" ]
49+
},
50+
"rosidl_typesupport_c": {
51+
"cmake-args": [ "-DBUILD_TESTING=OFF" ]
52+
},
53+
}
54+
}
2555
steps:
2656
- name: Install Java
2757
run: |
@@ -43,20 +73,25 @@ jobs:
4373
sudo apt-get update && sudo apt-get install -y python3-colcon-common-extensions python3-vcstool python3-lark-parser python3-dev
4474
- name: Install colcon extensions for Gradle
4575
run: |
46-
sudo pip3 install git+git://github.com/colcon/colcon-gradle.git
47-
sudo pip3 install git+git://github.com/colcon/colcon-ros-gradle.git
76+
sudo pip3 install git+https://github.com/colcon/colcon-gradle.git
77+
sudo pip3 install git+https://github.com/colcon/colcon-ros-gradle.git
4878
- name: Install Android NDK
4979
run: |
5080
curl -LO https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip
5181
unzip android-ndk-r21d-linux-x86_64.zip
82+
- name: Install QEMU emulation binaries
83+
run: |
84+
sudo apt-get update && sudo apt-get install -y qemu-user
5285
- name: Setup workspace with VCS repo file
5386
run: |
5487
mkdir -p ros2_java_ws/src
5588
cd ros2_java_ws
5689
curl -sL file://${{ github.workspace }}/ros2_java_android.repos | vcs import src
5790
# Use checked out version of ros2_java
58-
rm -rf src/ros2_java/ros2_java
59-
ln --symbolic ${{ github.workspace }} src/ros2_java
91+
rm -rf src/ros2-java/ros2_java
92+
ln --symbolic ${{ github.workspace }} src/ros2-java
93+
- name: Create colcon defaults file
94+
run: printf "${{matrix.colcon_meta}}" > ${{ github.workspace }}/colcon.meta
6095
- name: Build ros2_java for Android
6196
run: |
6297
export PYTHON3_EXEC="$( which python3 )"
@@ -69,9 +104,11 @@ jobs:
69104
70105
cd ros2_java_ws
71106
colcon build \
72-
--packages-ignore cyclonedds rcl_logging_log4cxx rosidl_generator_py \
107+
--packages-ignore cyclonedds rcl_logging_spdlog rcl_logging_log4cxx rosidl_generator_py \
73108
--packages-up-to rcljava \
109+
--metas ${{ github.workspace }}/colcon.meta \
74110
--cmake-args \
111+
-DRCL_LOGGING_IMPLEMENTATION=rcl_logging_noop \
75112
-DPYTHON_EXECUTABLE=${PYTHON3_EXEC} \
76113
-DPYTHON_LIBRARY=${PYTHON3_LIBRARY} \
77114
-DPYTHON_INCLUDE_DIR=${PYTHON3_INCLUDE_DIR} \
@@ -82,6 +119,9 @@ jobs:
82119
-DANDROID_STL=c++_shared \
83120
-DANDROID_ABI=${ANDROID_ABI} \
84121
-DANDROID_NDK=${ANDROID_NDK} \
122+
-DANDROID=ON \
123+
-DTHIRDPARTY_android-ifaddrs=FORCE \
85124
-DTHIRDPARTY=ON \
86125
-DCOMPILE_EXAMPLES=OFF \
87-
-DCMAKE_FIND_ROOT_PATH="${PWD}/install"
126+
-DCMAKE_FIND_ROOT_PATH="${PWD}/install" \
127+
-DCMAKE_CROSSCOMPILING_EMULATOR="/usr/bin/qemu-arm"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
| Target | Status |
66
|-------------------------------------------|---------------|
7-
| **ROS Dashing - Ubuntu Bionic (OpenJDK)** | ![Build Status](https://github.com/ros2-java/ros2_java/workflows/CI/badge.svg?branch=dashing) |
7+
| **ROS Galactic - Ubuntu Focal (OpenJDK)** | ![Build Status](https://github.com/ros2-java/ros2_java/workflows/CI/badge.svg?branch=main) |
88

99
## Introduction
1010

@@ -86,13 +86,13 @@ Make sure you have Gradle 3.2 (or later) installed.
8686

8787
1. Source your ROS 2 installation, for example:
8888

89-
source /opt/ros/dashing/setup.bash
89+
source /opt/ros/galactic/setup.bash
9090

9191
1. Download the ROS 2 Java repositories into a workspace:
9292

9393
mkdir -p ros2_java_ws/src
9494
cd ros2_java_ws
95-
curl -skL https://raw.githubusercontent.com/ros2-java/ros2_java/dashing/ros2_java_desktop.repos | vcs import src
95+
curl -skL https://raw.githubusercontent.com/ros2-java/ros2_java/main/ros2_java_desktop.repos | vcs import src
9696

9797
1. **Linux only** Install ROS dependencies:
9898

@@ -127,7 +127,7 @@ Although the `ros2_java_android.repos` file contains all the repositories for th
127127

128128
mkdir -p $HOME/ros2_android_ws/src
129129
cd $HOME/ros2_android_ws
130-
curl https://raw.githubusercontent.com/ros2-java/ros2_java/dashing/ros2_java_android.repos | vcs import src
130+
curl https://raw.githubusercontent.com/ros2-java/ros2_java/main/ros2_java_android.repos | vcs import src
131131

132132
1. Set Android build configuration:
133133

azure-pipelines.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

rcljava/include/org_ros2_rcljava_client_ClientImpl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ extern "C" {
2525
* Method: nativeSendClientRequest
2626
* Signature: (JJJJJLorg/ros2/rcljava/interfaces/MessageDefinition;)V
2727
*/
28-
JNIEXPORT void
28+
JNIEXPORT jlong
2929
JNICALL Java_org_ros2_rcljava_client_ClientImpl_nativeSendClientRequest(
30-
JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jobject);
30+
JNIEnv *, jclass, jlong, jlong, jlong, jlong, jobject);
3131

3232
/*
3333
* Class: org_ros2_rcljava_client_ClientImpl

rcljava/package.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<build_export_depend>builtin_interfaces</build_export_depend>
2323
<build_export_depend>rcl_interfaces</build_export_depend>
2424
<build_export_depend>rmw</build_export_depend>
25-
<build_export_depend>rosidl_generator_c</build_export_depend>
25+
<build_export_depend>rosidl_runtime_c</build_export_depend>
2626
<build_export_depend>rosidl_generator_java</build_export_depend>
2727
<build_export_depend>rosidl_typesupport_c</build_export_depend>
2828

@@ -31,7 +31,7 @@
3131
<exec_depend>rcl</exec_depend>
3232
<exec_depend>rmw_implementation_cmake</exec_depend>
3333
<exec_depend>rmw_implementation</exec_depend>
34-
<exec_depend>rosidl_generator_c</exec_depend>
34+
<exec_depend>rosidl_runtime_c</exec_depend>
3535
<exec_depend>rosidl_parser</exec_depend>
3636

3737
<test_depend>ament_lint_auto</test_depend>
@@ -41,7 +41,9 @@
4141
<test_depend>rcljava_common</test_depend>
4242
<test_depend>rmw_implementation_cmake</test_depend>
4343
<test_depend>rmw</test_depend>
44-
<test_depend>rosidl_generator_c</test_depend>
44+
<test_depend>rosidl_runtime_c</test_depend>
45+
<!--TODO(ivanpauno): we need this for some strange reason to make test builds-->
46+
<test_depend>rosidl_generator_cpp</test_depend>
4547
<test_depend>rosidl_generator_java</test_depend>
4648
<test_depend>std_msgs</test_depend>
4749

rcljava/src/main/cpp/org_ros2_rcljava_RCLJava.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "rcl/rcl.h"
2424
#include "rcl/timer.h"
2525
#include "rmw/rmw.h"
26-
#include "rosidl_generator_c/message_type_support_struct.h"
26+
#include "rosidl_runtime_c/message_type_support_struct.h"
2727

2828
#include "rcljava_common/exceptions.hpp"
2929
#include "rcljava_common/signatures.hpp"

rcljava/src/main/cpp/org_ros2_rcljava_client_ClientImpl.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "rcl/node.h"
2424
#include "rcl/rcl.h"
2525
#include "rmw/rmw.h"
26-
#include "rosidl_generator_c/message_type_support_struct.h"
26+
#include "rosidl_runtime_c/message_type_support_struct.h"
2727

2828
#include "rcljava_common/exceptions.hpp"
2929
#include "rcljava_common/signatures.hpp"
@@ -34,9 +34,9 @@ using rcljava_common::exceptions::rcljava_throw_rclexception;
3434
using rcljava_common::signatures::convert_from_java_signature;
3535
using rcljava_common::signatures::destroy_ros_message_signature;
3636

37-
JNIEXPORT void JNICALL
37+
JNIEXPORT jlong JNICALL
3838
Java_org_ros2_rcljava_client_ClientImpl_nativeSendClientRequest(
39-
JNIEnv * env, jclass, jlong client_handle, jlong sequence_number,
39+
JNIEnv * env, jclass, jlong client_handle,
4040
jlong jrequest_from_java_converter_handle, jlong jrequest_to_java_converter_handle,
4141
jlong jrequest_destructor_handle, jobject jrequest_msg)
4242
{
@@ -53,6 +53,7 @@ Java_org_ros2_rcljava_client_ClientImpl_nativeSendClientRequest(
5353

5454
void * request_msg = convert_from_java(jrequest_msg, nullptr);
5555

56+
int64_t sequence_number;
5657
rcl_ret_t ret = rcl_send_request(client, request_msg, &sequence_number);
5758

5859
destroy_ros_message_signature destroy_ros_message =
@@ -65,6 +66,7 @@ Java_org_ros2_rcljava_client_ClientImpl_nativeSendClientRequest(
6566
rcl_reset_error();
6667
rcljava_throw_rclexception(env, ret, msg);
6768
}
69+
return static_cast<jlong>(sequence_number);
6870
}
6971

7072
JNIEXPORT void JNICALL

rcljava/src/main/cpp/org_ros2_rcljava_executors_BaseExecutor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "rcl/rcl.h"
2424
#include "rcl/timer.h"
2525
#include "rmw/rmw.h"
26-
#include "rosidl_generator_c/message_type_support_struct.h"
26+
#include "rosidl_runtime_c/message_type_support_struct.h"
2727

2828
#include "rcljava_common/exceptions.hpp"
2929
#include "rcljava_common/signatures.hpp"

rcljava/src/main/cpp/org_ros2_rcljava_node_NodeImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "rcl/node.h"
2323
#include "rcl/rcl.h"
2424
#include "rmw/rmw.h"
25-
#include "rosidl_generator_c/message_type_support_struct.h"
25+
#include "rosidl_runtime_c/message_type_support_struct.h"
2626

2727
#include "rcljava_common/exceptions.hpp"
2828
#include "rcljava_common/signatures.hpp"

rcljava/src/main/cpp/org_ros2_rcljava_service_ServiceImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "rcl/node.h"
2323
#include "rcl/rcl.h"
2424
#include "rmw/rmw.h"
25-
#include "rosidl_generator_c/message_type_support_struct.h"
25+
#include "rosidl_runtime_c/message_type_support_struct.h"
2626

2727
#include "rcljava_common/exceptions.hpp"
2828
#include "rcljava_common/signatures.hpp"

0 commit comments

Comments
 (0)