Skip to content

Build issue with humble-future branch of events executor (timer reset support) #2939

@sudhanva-ns

Description

@sudhanva-ns

I’m attempting to use iRobot’s events executor with ROS 2 Humble and am trying to build the humble-future branch of the events executor.

As noted in the README, this branch requires additional support from rclcpp and rcl for resetting timers. I cherry-picked the recommended commits, but I’m running into the following build error when compiling rclcpp:

--- stderr: rclcpp                               
/irobot_ws/src/rclcpp/rclcpp/src/rclcpp/timer.cpp: In member function ‘void rclcpp::TimerBase::set_on_reset_callback(std::function<void(long unsigned int)>)’:
/irobot_ws/src/rclcpp/rclcpp/src/rclcpp/timer.cpp:186:21: error: function template-id ‘cpp_callback_trampoline<rclcpp::TimerBase::set_on_reset_callback(std::function<void(long unsigned int)>)::<lambda(size_t)>, const void*, size_t>’ in nested-name-specifier
  186 |     rclcpp::detail::cpp_callback_trampoline<
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
  187 |       decltype(new_callback), const void *, size_t>::callback,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /irobot_ws/src/rclcpp/rclcpp/src/rclcpp/timer.cpp:25:
/irobot_ws/src/rclcpp/rclcpp/include/rclcpp/detail/cpp_callback_trampoline.hpp:58:1: note: ‘template<class UserDataT, class ... Args, class ReturnT> ReturnT rclcpp::detail::cpp_callback_trampoline(UserDataT, Args ...)’ declared here
   58 | cpp_callback_trampoline(UserDataT user_data, Args ... args) noexcept
      | ^~~~~~~~~~~~~~~~~~~~~~~
/irobot_ws/src/rclcpp/rclcpp/src/rclcpp/timer.cpp:194:24: error: no matching function for call to ‘rclcpp::TimerBase::set_on_reset_callback(<unresolved overloaded function type>, const void*)’
  194 |   set_on_reset_callback(
      |   ~~~~~~~~~~~~~~~~~~~~~^
  195 |     rclcpp::detail::cpp_callback_trampoline<
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  196 |       decltype(on_reset_callback_), const void *, size_t>,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  197 |     static_cast<const void *>(&on_reset_callback_));
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/irobot_ws/src/rclcpp/rclcpp/src/rclcpp/timer.cpp:152:1: note: candidate: ‘void rclcpp::TimerBase::set_on_reset_callback(std::function<void(size_t)>)’
  152 | TimerBase::set_on_reset_callback(std::function<void(size_t)> callback)
      | ^~~~~~~~~
/irobot_ws/src/rclcpp/rclcpp/src/rclcpp/timer.cpp:152:1: note:   candidate expects 1 argument, 2 provided
In file included from /irobot_ws/src/rclcpp/rclcpp/src/rclcpp/timer.cpp:15:
/irobot_ws/src/rclcpp/rclcpp/include/rclcpp/timer.hpp:193:3: note: candidate: ‘void rclcpp::TimerBase::set_on_reset_callback(rcl_event_callback_t, const void*)’
  193 |   set_on_reset_callback(rcl_event_callback_t callback, const void * user_data);
      |   ^~~~~~~~~~~~~~~~~~~~~
/irobot_ws/src/rclcpp/rclcpp/include/rclcpp/timer.hpp:193:46: note:   no known conversion for argument 1 from ‘<unresolved overloaded function type>’ to ‘rcl_event_callback_t’ {aka ‘void (*)(const void*, long unsigned int)’}
  193 |   set_on_reset_callback(rcl_event_callback_t callback, const void * user_data);
      |                         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
gmake[2]: *** [CMakeFiles/rclcpp.dir/build.make:1119: CMakeFiles/rclcpp.dir/src/rclcpp/timer.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:465: CMakeFiles/rclcpp.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

Environment

OS: Ubuntu 22.04

ROS 2: Humble

Question

Has anyone successfully built the humble-future branch of events executor with timer reset support? Am I missing a required patch or dependency in rclcpp/rcl?

Any guidance or confirmation on the correct set of commits needed would be greatly appreciated.

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