ros2 / rosidl_typesupport

Packages which provide the typesupport for ROS messages and services
Apache License 2.0
13 stars 34 forks source link

No 'rosidl_typesupport_c' found when building for Android NDK #129

Open mpconte opened 1 year ago

mpconte commented 1 year ago

Bug report

Required Info:

Steps to reproduce issue

After following the instructions for building ros2 libraries via the following repo https://github.com/sloretz/sensors_for_ros, I wanted to build another project with an updated CMAKE_FIND_ROOT_PATH set to the location of these built libraries from this repo

I then tried to build a project with a CMakeLists.txt files like below:

set(CMAKE_TOOLCHAIN_FILE ${ANDROID_NDK}/build/cmake/android.toolchain.cmake)
set(PYTHONPATH ${CMAKE_FIND_ROOT_PATH}/_python_)
set(AMENT_PREFIX_PATH ${CMAKE_FIND_ROOT_PATH})
set(ANDROID_PLATFORM android-${ANDROID_API_MIN})

cmake_minimum_required(VERSION 3.12)

project(multisensor_framework)

find_package(ament_cmake REQUIRED)
find_package(common_interfaces REQUIRED)
find_package(rosidl_typesupport_c REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
  "msg/Radar.msg"
  "msg/Finished.msg"
  "msg/Recipe.msg"
  "msg/Odometer.msg"
  "msg/RawNMEA.msg"
  "msg/MetaData.msg"
  "msg/StandardResponse.msg"
  "msg/StandardFloatDataResponse.msg"
  "srv/GPRControl.srv"
  "srv/GPRControlRate.srv"
  "srv/MetaData.srv"  
  DEPENDENCIES builtin_interfaces std_msgs
)

ament_package()

Using the following cmake command:

cmake -DANDROID_NDK=/root/android-ndk-r25b -DANDROID_API_MIN=31 -DANDROID_ARCH_ABI=arm64-v8a -DCMAKE_FIND_ROOT_PATH=/root/workspace/ros2-build/build/deps ..

Expected behavior

builtin_interfaces should be build

Actual behavior

-- Found ament_cmake: 1.3.3 (/root/workspace/ros2-build/build/deps/share/ament_cmake/cmake)
-- Found Python3: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter 
-- Found common_interfaces: 4.2.2 (/root/workspace/ros2-build/build/deps/share/common_interfaces/cmake)
-- Found rosidl_typesupport_c: 2.0.0 (/root/workspace/ros2-build/build/deps/share/rosidl_typesupport_c/cmake)
CMake Error at /root/workspace/ros2-build/build/deps/share/rosidl_typesupport_c/cmake/get_used_typesupports.cmake:35 (message):
  No 'rosidl_typesupport_c' found
Call Stack (most recent call first):
  /root/workspace/ros2-build/build/deps/share/rosidl_typesupport_c/cmake/rosidl_typesupport_c-extras.cmake:8 (get_used_typesupports)
  /root/workspace/ros2-build/build/deps/share/rosidl_typesupport_c/cmake/rosidl_typesupport_cConfig.cmake:41 (include)
  sensor_network_interfaces/CMakeLists.txt:11 (find_package)

Additional information

sorensej commented 1 year ago

I am having a similar issue. Were you able to find a fix?

CursedRock17 commented 1 year ago

The author that library has two listings here where they explain not finding rosidl_typesupport_c and quick fixes.