Skip to content

[Documentation] - Create and build messages #129

@xas

Description

@xas

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions