Colcon Build Fail When Creating Workspace

asked 2021-11-30 02:29:37 -0500

dayiethan gravatar image

I am following the ROS2 Foxy tutorial here: https://docs.ros.org/en/foxy/Tutorial... However, when I get to the "colcon build" step, it fails with exit code 2 and "stderr: turtlesim" with very little description as to why. I think I have all the dependencies installed and everything up to date so I am not sure why this is happening. I am working on Ubuntu 20.04.

This is the error message: make[2]: * [CMakeFiles/turtlesin_rosidl_typesupport_cpp.dir/build.make:82:rosidl_typesupport_cpp/turtlesin/action/rotate_absolu te_type_support.cpp] Error 1 make[2]: Deleting file *rosidl_typesupport_cpp/turtlesin/action/rotate_absolute_ _type support. cDD" make[1]: [CMakeFiles/Makefile2:451: CMakeFiles/turtlesin_rosidl_typesupport_cpp.dir/all]Error2 make: * (Makefile: 141: all] Error 2 Failed << turtlesin [0.75s, exited with code 2]

edit retag flag offensive close merge delete

Comments

There is a typo in your setup as it’s turtlesim vs turtlesin

osilva gravatar image osilva  ( 2021-11-30 17:38:47 -0500 )edit

Check if you have renamed the turtlesim folder accidentally after you clone ros tutorials. This error is happening when you apply colcon build because it generates unexpected path files as per your error and final message.

osilva gravatar image osilva  ( 2021-11-30 17:55:28 -0500 )edit

Oops sorry I got that text by taking a picture of my screen so the text just didn't get read over well. It seems to be spelled correctly on my end.

dayiethan gravatar image dayiethan  ( 2021-12-01 00:39:01 -0500 )edit

There is other ms in the text, double check pls

osilva gravatar image osilva  ( 2021-12-01 02:00:17 -0500 )edit

Wait sorry, I don't quite understand. I think that all of them are supposed to be turtlesim and in my terminal they are written as such. It just won't seem to build when I run "build colcon". I'm not quite sure what could be the issue because the error message has very little information and the tutorial is fairly simple. Thank you for your help by the way!

dayiethan gravatar image dayiethan  ( 2021-12-01 02:17:41 -0500 )edit

Can you please show the output of your install:

cd ~/dev_ws/src/ros_ tutorials

ls

osilva gravatar image osilva  ( 2021-12-01 02:23:37 -0500 )edit

In that folder I have: roscpp_tutorials rospy_tutorials ros_tutorials turtlesim I do know that all but the turtlesim have COLCON_IGNORE so only turtlesim should be building when I run colcon build

dayiethan gravatar image dayiethan  ( 2021-12-01 02:25:15 -0500 )edit

And what is inside turtlesim/src pls copy paste the output.

osilva gravatar image osilva  ( 2021-12-01 02:34:34 -0500 )edit

Also do you have action folder in the turtlesim folder?

osilva gravatar image osilva  ( 2021-12-01 02:37:55 -0500 )edit

The turtlesim/src folder contains: "turtle.cpp turtle_frame.cpp turtlesim turtlesim.cpp" Also, I do have an action folder inside the turtlesim folder.

dayiethan gravatar image dayiethan  ( 2021-12-01 02:44:07 -0500 )edit

Ok perfect we can now discard installation. Please be patient

Can you output CMakelists.txt to see if somehow the error is there

osilva gravatar image osilva  ( 2021-12-01 03:54:21 -0500 )edit

Should I just delete the whole thing and try again, is that what you mean? Frankly, it wouldn't take very long to redo. I see the CMakelists.txt file but there doesn't seem to be anything of interest in there and plus it is a ros2 repo so I don't suspect there would be any issues.

dayiethan gravatar image dayiethan  ( 2021-12-01 09:38:38 -0500 )edit