ros2-dotnet/ros2_dotnet

[Documentation] - Create and build messages

xas opened this issue · 0 comments

xas commented

Hi,

I am a dotnet dev, but totally new with ROS2.

I did ok with some python tutorials, but now trying to migrate the code to ROS2.NET

I am trying to understand how to build any message (currently action msg) but I am failing miserably.

I am not sure how correctly fill the CMakeLists.txt (currently it is just by guessing 😞). My questions are:

  • Can I create a new workspace with a new package only with action messages ? Or should I keep it into the dotnet ws ?
  • I have some errors when trying to colcon build (see below), but I am not an expert of cmake, so I must be missing some packages/linker/...?

Can someone guide me ?

PS: The building errors:

CMake Error: Cannot determine link language for target "cloudnet__rosidl_typesupport_fastrtps_c".
CMake Error: CMake can not determine linker language for target: cloudnet__rosidl_typesupport_fastrtps_c
CMake Error: Cannot determine link language for target "cloudnet__rosidl_typesupport_fastrtps_cpp".
CMake Error: CMake can not determine linker language for target: cloudnet__rosidl_typesupport_fastrtps_cpp
CMake Error: Cannot determine link language for target "cloudnet__rosidl_typesupport_c".
CMake Error: CMake can not determine linker language for target: cloudnet__rosidl_typesupport_c
CMake Error: Cannot determine link language for target "cloudnet__rosidl_typesupport_introspection_cpp".
CMake Error: CMake can not determine linker language for target: cloudnet__rosidl_typesupport_introspection_cpp
CMake Error: Cannot determine link language for target "cloudnet__rosidl_typesupport_cpp".
CMake Error: CMake can not determine linker language for target: cloudnet__rosidl_typesupport_cpp

The CMakeLists.txt

cmake_minimum_required(VERSION 3.5)
project(cloudnet C)

find_package(ament_cmake REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(unique_identifier_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
  "action/OneAction.action"
  DEPENDENCIES builtin_interfaces action_msgs unique_identifier_msgs
  ADD_LINTER_TESTS
)

ament_export_dependencies(rosidl_default_runtime)
ament_package()