Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rosidl cli generate proto test #25

Open
wants to merge 4 commits into
base: streamline-file-generation
Choose a base branch
from

Conversation

gonzodepedro
Copy link
Collaborator

Adds tests for rosidl cli generate typesupports for protobuf

@gonzodepedro
Copy link
Collaborator Author

Get paths from get_package_share_directory

      package_share_path = pathlib.Path(
            get_package_share_directory('rosidl_typesupport_protobuf_c'))

@gonzodepedro
Copy link
Collaborator Author

Check that it is creating typeadapters

@gonzodepedro
Copy link
Collaborator Author

Both comments are fixed now


subprocess.run([
'rosidl', 'generate', '-ts', 'protobuf_c', '-o', output_path, 'std_msgs', './msg/String.msg'
], cwd='/home/aeten/ros2_rolling/install/std_msgs/share/std_msgs', check=True)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard coded path still here

@@ -115,6 +115,8 @@ if(BUILD_TESTING)
target_link_libraries(test_wstring_conversion
${PROJECT_NAME})
endif()
find_package(ament_cmake_pytest REQUIRED)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed in package.xml too

@tfoote
Copy link
Owner

tfoote commented Mar 25, 2024

Current failure:

  CMake Error at /__w/rosidl_typesupport_protobuf/rosidl_typesupport_protobuf/ros_ws/install/rosidl_typesupport_protobuf_c/share/rosidl_typesupport_protobuf_c/cmake/rosidl_typesupport_protobuf_c_generate_interfaces.cmake:41 (add_library):
    No SOURCES given to target:
    rosidl_generator_py_custom__rosidl_typesupport_protobuf_c
  Call Stack (most recent call first):
    /__w/rosidl_typesupport_protobuf/rosidl_typesupport_protobuf/ros_ws/install/ament_cmake_core/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
    /__w/rosidl_typesupport_protobuf/rosidl_typesupport_protobuf/ros_ws/install/rosidl_cmake/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
    CMakeLists.txt:56 (rosidl_generate_interfaces)

This looks like it's trying to compile the library before it's generated. We need a dependency in CMake to prevent this.

@gonzodepedro
Copy link
Collaborator Author

This PR must be compiled using this repos file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants