ros2 / examples

Example packages for ROS 2
Apache License 2.0
681 stars 308 forks source link

colcon build --symlink-install,error~~ #386

Closed longmarchw closed 1 month ago

longmarchw commented 1 month ago

Bug report

Required Info:

Steps to reproduce issue

When I refer to **https://docs.ros.org/en/rolling/Tutorials/Beginner-Client-Libraries/Colcon-Tutorial.html** to execute **colcon build --symlink-install**, the compilation error: 

### /ros2_ws/src/examples/rclcpp/wait_set/src/wait_set_topics_and_timer.cpp: In function ‘int32_t main(int32_t, char**)’:
/ros2_ws/src/examples/rclcpp/wait_set/src/wait_set_topics_and_timer.cpp:76:42: error: no matching function for call to ‘rclcpp::TimerBase::execute_callback(bool&)’
   76 |           one_off_timer->execute_callback(data);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /opt/ros/rolling/include/rclcpp/rclcpp/callback_group.hpp:30,
                 from /opt/ros/rolling/include/rclcpp/rclcpp/any_executable.hpp:20,
                 from /opt/ros/rolling/include/rclcpp/rclcpp/memory_strategy.hpp:25,
                 from /opt/ros/rolling/include/rclcpp/rclcpp/memory_strategies.hpp:18,
                 from /opt/ros/rolling/include/rclcpp/rclcpp/executor_options.hpp:20,
                 from /opt/ros/rolling/include/rclcpp/rclcpp/executor.hpp:37,
                 from /opt/ros/rolling/include/rclcpp/rclcpp/executors/multi_threaded_executor.hpp:25,
                 from /opt/ros/rolling/include/rclcpp/rclcpp/executors.hpp:21,
                 from /opt/ros/rolling/include/rclcpp/rclcpp/rclcpp.hpp:172,
                 from /ros2_ws/src/examples/rclcpp/wait_set/src/wait_set_topics_and_timer.cpp:17:
/opt/ros/rolling/include/rclcpp/rclcpp/timer.hpp:113:3: note: candidate: ‘virtual void rclcpp::TimerBase::execute_callback()’
  113 |   execute_callback() = 0;
      |   ^~~~~~~~~~~~~~~~
/opt/ros/rolling/include/rclcpp/rclcpp/timer.hpp:113:3: note:   candidate expects 0 arguments, 1 provided
gmake[2]: *** [CMakeFiles/wait_set_topics_and_timer.dir/build.make:76: CMakeFiles/wait_set_topics_and_timer.dir/src/wait_set_topics_and_timer.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:341: CMakeFiles/wait_set_topics_and_timer.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< examples_rclcpp_wait_set [15.5s, exited with code 2]
Aborted  <<< examples_rclcpp_minimal_subscriber [16.1s]                                                                                                       
Aborted  <<< examples_rclcpp_minimal_composition [18.8s] 

What should I do?

Expected behavior

Actual behavior

Additional information


Feature request

Feature description

Implementation considerations

clalancette commented 1 month ago

Please open questions like this on https://robotics.stackexchange.com/questions/tagged/ros, which is our central Question and Answer site. You'll get a better answer there, and it will be searchable for the future.

Make sure to include a lot of information on what platform you are using, which ROS distribution you are using, and the exact steps you took.