ros-safety / software_watchdogs

A library of (software) watchdogs based on DDS Quality of Service (QoS) policies and ROS 2 lifecycle nodes.
Apache License 2.0
71 stars 17 forks source link

typesupport library issues #7

Closed vinnnyr closed 3 years ago

vinnnyr commented 3 years ago

Not sure if this is an issue with the package or something I am doing wrong. I am trying to set this package as a dependency for another package so I can use the message type. Any help would be greatly appreciated.

Relevant Snippet:

  Package 'sw_watchdog' exports the typesupport library
  'sw_watchdog_msgs__rosidl_typesupport_fastrtps_c' which couldn't be found

Full error:

Starting >>> sw_watchdog
Finished <<< sw_watchdog [0.35s]                     
Starting >>> my_robot_safety
--- stderr: my_robot_safety                         
CMake Error at /home/vinny/Code/my_robot_ros2_ws/install/sw_watchdog/share/sw_watchdog/cmake/rosidl_cmake_export_typesupport_libraries-extras.cmake:26 (message):
  Package 'sw_watchdog' exports the typesupport library
  'sw_watchdog_msgs__rosidl_typesupport_fastrtps_c' which couldn't be found
Call Stack (most recent call first):
  /home/vinny/Code/my_robot_ros2_ws/install/sw_watchdog/share/sw_watchdog/cmake/sw_watchdogConfig.cmake:41 (include)
  CMakeLists.txt:6 (find_package)

make: *** [Makefile:222: cmake_check_build_system] Error 1
---
Failed   <<< my_robot_safety [0.57s, exited with code 2]

Snippet from my CMakeLists

 find_package(ament_cmake REQUIRED)
 find_package(rclcpp REQUIRED)
 find_package(sw_watchdog REQUIRED)

 include_directories(
   include
 )

 set(dependencies
     rclcpp
     sw_watchdog
 )

 if(BUILD_TESTING)
   find_package(ament_lint_auto REQUIRED)
   ament_lint_auto_find_test_dependencies()
   find_package(ament_cmake_gtest REQUIRED)
   add_subdirectory(test)
 endif()
robbel commented 3 years ago

I don't have access to test at this moment but does a switch to sw_watchdog_msgs under dependencies result in a different outcome?

vinnnyr commented 3 years ago

No, a switch to sw_watchdog_msgs did not result in anything different

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(sw_watchdog REQUIRED)

include_directories(
  include
)

set(dependencies
    rclcpp
    sw_watchdog_msgs
)

Error:

  Package 'sw_watchdog' exports the typesupport library
  'sw_watchdog_msgs__rosidl_typesupport_fastrtps_c' which couldn't be found
vinnnyr commented 3 years ago

I have also just tested this in a fresh container with the same issue.

vinnnyr commented 3 years ago

Just submitted #8, I think the issue stems from these lines:

I believe an appropriate resolution is to separate out the messages into it's own package.

togaen commented 3 years ago

@vinnnyr I'm curious: what is your use case for using these messages outside of the watchdog library?

vinnnyr commented 3 years ago

@togaen I am developing a package to communicate autonomy "readiness" between two machines with divided responsibilities.

It is a "leader" "follower" scheme, and we use the Heartbeat message to establish reliable communication as well as communicate status/checkpoint with the checkpoint_id. We increment the checkpoint_id as we progress in levels of "readiness" on both machines.

We thought it was better to use the established heartbeat message like this instead of come up with our own.

Although I think this might be somewhat specific to our machine type, when we are done testing we can offer to upstream this package here to show as an example if there is interest.

togaen commented 3 years ago

Cool, thanks for the info!