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

Add support for Humble #685

Closed
wants to merge 2 commits into from

Conversation

shrijitsingh99
Copy link

Fixes dependencies and build issues while building for Humble
Updates geos library with and uses their new API
Fixes CMake issues

@danthony06
Copy link
Contributor

danthony06 commented Sep 17, 2022 via email

@@ -16,7 +16,28 @@ find_package(std_srvs REQUIRED)

# TODO pjr What to do about swri_roscpp-extras.cmake?

### Build Test Node ###
add_library(${PROJECT_NAME} INTERFACE)
Copy link
Contributor

Choose a reason for hiding this comment

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

This will cause a cmake error if tests are not disabled; a target named ${PROJECT_NAME} is already defined below at line 105 with rosidl_generate_interfaces(${PROJECT_NAME}. If this needs to be built and installed as a library, I would recommend renaming the test target.

@@ -88,7 +109,8 @@ if (BUILD_TESTING)
)

ament_add_gtest(topic_service_test_server test/topic_service_test.cpp)
rosidl_target_interfaces(topic_service_test_server ${PROJECT_NAME} "rosidl_typesupport_cpp")
rosidl_get_typesupport_target(cpp_typesupport_target "${PROJECT_NAME}" "rosidl_typesupport_cpp")
Copy link
Contributor

@pjreed pjreed Sep 19, 2022

Choose a reason for hiding this comment

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

This will fail to compile on ROS Galactic or earlier because rosidl_get_typesupport_target does not exist.

You could replace this with something like:

if ("$ENV{ROS_DISTRO}" STRGREATER "galactic")
  rosidl_get_typesupport_target(cpp_typesupport_target "${PROJECT_NAME}_test" "rosidl_typesupport_cpp")
  target_link_libraries(topic_service_test_server "${cpp_typesupport_target}")
else()
  rosidl_target_interfaces(topic_service_test_server "${PROJECT_NAME}_test" "rosidl_typesupport_cpp")
endif()
  target_link_libraries(topic_service_test_server
    Boost::system
    swri_roscpp_test__rosidl_typesupport_cpp
  )

Note that rosidl_generate_interfaces(${PROJECT_NAME} above would also need to be changed to rosidl_generate_interfaces(${PROJECT_NAME}_test to reflect the new target name.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can also confirm it's broken on prior ROS2 releases.

@@ -36,7 +36,7 @@
#include <rcl_interfaces/msg/floating_point_range.hpp>
#include <rcl_interfaces/msg/parameter_descriptor.hpp>
#include <tf2_ros/transform_broadcaster.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

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

This, and all other files that include tf2_geometry_msgs.hpp, will fail to compile on ROS Galactic and earlier because there the file is named tf2_geometry_msgs.h. Unfortunately, while that file exists in Humble, including it will print a warning that cannot be suppressed, which is incredibly annoying.

Probably the best way to make this work across different ROS2 releases is to modify the CMakeLists.txt to pull the ROS_DISTRO environment variable and set that in a compiler definition, then use preprocessor macros here to conditionally include either tf2_geometry_msgs.h or tf2_geometry_msgs.hpp.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can confirm it's broken on prior ROS2 releases.

swri_geometry_util/CMakeLists.txt Show resolved Hide resolved
@danthony06
Copy link
Contributor

@shrijitsingh99 did you want to make these changes? Otherwise I can fork your changes and make them.

@danthony06
Copy link
Contributor

@pjreed I've started working on the C API switch here: https://github.com/danthony06/marti_common/tree/c_api_switch.

@danthony06
Copy link
Contributor

@pjreed My C API branch is now building and passing tests, but I'm not entirely happy with the implementation and how it's handling GEOS contexts.

@danthony06
Copy link
Contributor

I've started working on bringing these changes into a branch here: https://github.com/danthony06/marti_common/tree/humble_support

@shrijitsingh99
Copy link
Author

@danthony06 Thanks for taking over this. I have not have had the cycles to take this further, sorry about that.
This is still a dependency for my project, and have more time now. Let me know if there is anyway I can help out.

@danthony06
Copy link
Contributor

@shrijitsingh99 Thank you for all your help on this. I've based a new PR on this over here: #691. I'm closing this PR in favor of the other one.

@danthony06 danthony06 closed this Oct 7, 2022
@danthony06 danthony06 mentioned this pull request Oct 7, 2022
danthony06 added a commit that referenced this pull request Oct 10, 2022
* Adding Humble support based on @shrijitsingh99 PR in #685
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.

None yet

3 participants