colcon build failed on ros2
i was following this official tutorial with my raspberry pi 4. i was executing
colcon build
but every time i execute that, i get:
[1.935s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
'turtlesim' is in: /opt/ros/humble
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.
If you understand the risks and want to override a package anyways, add the following to the command line:
--allow-overriding turtlesim
This may be promoted to an error in a future release of colcon-override-check.
Starting >>> turtlesim
[Processing: turtlesim]
[Processing: turtlesim]
[Processing: turtlesim]
[Processing: turtlesim]
--- stderr: turtlesim
CMake Deprecation Warning at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_target_interfaces.cmake:32 (message):
Use rosidl_get_typesupport_target() and target_link_libraries() instead of
rosidl_target_interfaces()
Call Stack (most recent call first):
CMakeLists.txt:51 (rosidl_target_interfaces)
CMake Deprecation Warning at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_target_interfaces.cmake:32 (message):
Use rosidl_get_typesupport_target() and target_link_libraries() instead of
rosidl_target_interfaces()
Call Stack (most recent call first):
CMakeLists.txt:55 (rosidl_target_interfaces)
CMake Deprecation Warning at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_target_interfaces.cmake:32 (message):
Use rosidl_get_typesupport_target() and target_link_libraries() instead of
rosidl_target_interfaces()
Call Stack (most recent call first):
CMakeLists.txt:58 (rosidl_target_interfaces)
CMake Deprecation Warning at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_target_interfaces.cmake:32 (message):
Use rosidl_get_typesupport_target() and target_link_libraries() instead of
rosidl_target_interfaces()
Call Stack (most recent call first):
CMakeLists.txt:61 (rosidl_target_interfaces)
/home/pi/ros2_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp: In member function ‘void TeleopTurtle::sendGoal(float)’:
/home/pi/ros2_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp:200:5: error: no match for ‘operator=’ (operand types are ‘rclcpp_action::Client<turtlesim::action::RotateAbsolute>::GoalResponseCallback’ {aka ‘std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>’} and ‘TeleopTurtle::sendGoal(float)::<lambda(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > >)>’)
200 | };
| ^
In file included from /usr/include/c++/11/future:47,
from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:18,
from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
from /home/pi/ros2_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp:1:
/usr/include/c++/11/bits/std_function.h:530:9: note: candidate: ‘template<class _Functor> std::function<_Res(_ArgTypes ...)>::_Requires<std::function<_Res(_ArgTypes ...)>::_Callable<_Functor>, std::function<_Res(_ArgTypes ...)>&> std::function<_Res(_ArgTypes ...)>::operator=(_Functor&&) [with _Functor = _Functor; _Res = void; _ArgTypes = {std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >}]’
530 | operator=(_Functor&& __f)
| ^~~~~~~~
/usr/include/c++/11/bits/std_function.h:530:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/11/bits/move.h:57,
from /usr/include/c++/11/bits/stl_pair.h:59,
from /usr/include/c++/11/bits/stl_algobase.h:64,
from /usr/include/c++/11/memory ...