ros2-dotnet / ros2_dotnet

.NET bindings for ROS2
Apache License 2.0
136 stars 54 forks source link

[Documentation] - Create and build messages #129

Open xas opened 2 months ago

xas commented 2 months ago

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 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()