ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

colcon can't build turtlesim

asked 2022-06-26 11:39:20 -0500

adroit.levees.0r gravatar image

updated 2022-06-26 11:40:59 -0500

I was following official tutorials here in Python. After "Creating custom msg and srv files" tutorial I decided to switch language from Python to C++ and start tutorials from scratch. I moved "~/dev_ws" folder, and created empty "~/dev_ws" folder on its place. I started tutorials from Creating a workspace. And I have the following error when I do colcon build (Ubuntu 20.04, installed from deb, --allow-overriding turtlesim doesn't help):

[0.227s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
        'turtlesim' is in: /opt/ros/galactic
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
--- stderr: turtlesim                             
In file included from /opt/ros/galactic/include/rclcpp/topic_statistics/subscription_topic_statistics.hpp:31,
                 from /opt/ros/galactic/include/rclcpp/subscription.hpp:50,
                 from /opt/ros/galactic/include/rclcpp/any_executable.hpp:25,
                 from /opt/ros/galactic/include/rclcpp/memory_strategy.hpp:25,
                 from /opt/ros/galactic/include/rclcpp/memory_strategies.hpp:18,
                 from /opt/ros/galactic/include/rclcpp/executor_options.hpp:20,
                 from /opt/ros/galactic/include/rclcpp/executor.hpp:36,
                 from /opt/ros/galactic/include/rclcpp/executors/multi_threaded_executor.hpp:26,
                 from /opt/ros/galactic/include/rclcpp/executors.hpp:21,
                 from /opt/ros/galactic/include/rclcpp/rclcpp.hpp:156,
                 from /home/alexander/dev_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp:5:
/opt/ros/galactic/include/rclcpp/publisher.hpp: In instantiation of ‘void rclcpp::Publisher<MessageT, AllocatorT>::do_inter_process_publish(const MessageT&, uint32_t*) [with MessageT = geometry_msgs::msg::Twist_<std::allocator<void> >; AllocatorT = std::allocator<void>; uint32_t = unsigned int]’:
/opt/ros/galactic/include/rclcpp/publisher.hpp:233:52:   required from ‘void rclcpp::Publisher<MessageT, AllocatorT>::publish(const MessageT&, uint32_t*) [with MessageT = geometry_msgs::msg::Twist_<std::allocator<void> >; AllocatorT = std::allocator<void>; uint32_t = unsigned int]’
/opt/ros/galactic/include/rclcpp/publisher.hpp:228:3:   required from here
/opt/ros/galactic/include/rclcpp/publisher.hpp:328:38: error: ‘rcl_publish_with_id’ was not declared in this scope; did you mean ‘rmw_publish_with_id’?
  328 |     auto status = rcl_publish_with_id(publisher_handle_.get(), &msg, nullptr, id);
      |                   ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   rmw_publish_with_id
make[2]: *** [CMakeFiles/turtle_teleop_key.dir/build.make:63: CMakeFiles/turtle_teleop_key.dir/tutorials/teleop_turtle_key.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:339: CMakeFiles/turtle_teleop_key.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /opt/ros/galactic/include/rclcpp/topic_statistics/subscription_topic_statistics.hpp:31,
                 from /opt/ros/galactic/include/rclcpp/subscription.hpp:50,
                 from /opt/ros/galactic/include/rclcpp/any_executable.hpp:25,
                 from /opt/ros/galactic/include/rclcpp/memory_strategy.hpp:25,
                 from /opt/ros/galactic ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2022-06-26 12:19:59 -0500

adroit.levees.0r gravatar image

I uninstalled ROS: sudo apt remove ros-galactic* and installed it again sudo apt install ros-galactic-desktop. It seems to work

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-06-26 11:39:20 -0500

Seen: 219 times

Last updated: Jun 26 '22