accidentally deleted build folder inside the catkin_ws folder
I accidentally deleted the build
folder inside the catkin_ws
directory by running rm -rf build
inside the catkin_ws
directory. It seems to have broken some things. I am not able to build any package by running catkin build <package_name>
.
Is there a way I can fix the issue?
This is the terminal output -
Profile: default
Extending: [cached] /opt/ros/melodic
Workspace: /home/skpro19/catkin_ws
------------------------------------------------------------
Build Space: [exists] /home/skpro19/catkin_ws/build
Devel Space: [exists] /home/skpro19/catkin_ws/devel
Install Space: [unused] /home/skpro19/catkin_ws/install
Log Space: [exists] /home/skpro19/catkin_ws/logs
Source Space: [exists] /home/skpro19/catkin_ws/src
DESTDIR: [unused] None
------------------------------------------------------------
Devel Space Layout: linked
Install Space Layout: None
------------------------------------------------------------
Additional CMake Args: None
Additional Make Args: None
Additional catkin Make Args: None
Internal Make Job Server: True
Cache Job Environments: False
------------------------------------------------------------
Whitelisted Packages: None
Blacklisted Packages: None
------------------------------------------------------------
Workspace configuration appears valid.
------------------------------------------------------------
[build] Found '105' packages in 0.0 seconds.
[build] Package table is up to date.
Starting >>> controller_manager_msgs
Starting >>> gazebo_dev
Starting >>> geometry_msgs
Starting >>> grid_map_core
Starting >>> husky_description
Starting >>> husky_msgs
Starting >>> map_msgs
Starting >>> my_turtlebot2_training
Finished <<< my_turtlebot2_training [ 0.1 seconds ]
Starting >>> roscpp
Finished <<< gazebo_dev [ 0.1 seconds ]
Starting >>> tf
Finished <<< grid_map_core [ 0.2 seconds ]
Finished <<< husky_description [ 0.1 seconds ]
Finished <<< geometry_msgs [ 0.2 seconds ]
Finished <<< husky_msgs [ 0.4 seconds ]
Starting >>> grid_map_cv
Starting >>> grid_map_octomap
Starting >>> grid_map_sdf
Starting >>> autonomous_mapping_package
Finished <<< roscpp [ 0.1 seconds ]
Starting >>> exploration_msgs
Finished <<< controller_manager_msgs [ 0.5 seconds ]
Starting >>> gazebo_msgs
Finished <<< tf [ 0.1 seconds ]
Starting >>> move_base_msgs
Finished <<< grid_map_octomap [ 0.2 seconds ]
Starting >>> teleop_twist_keyboard
Finished <<< grid_map_sdf [ 0.2 seconds ]
Starting >>> tf2_msgs
__________________________________________________________________________
Errors << map_msgs:cmake /home/skpro19/catkin_ws/logs/map_msgs/build.cmake.006.log
CMake Error at /home/skpro19/catkin_ws/build/map_msgs/cmake/map_msgs-genmsg.cmake:3 (message):
Could not find messages which
'/home/skpro19/catkin_ws/src/navigation_msgs/map_msgs/msg/ProjectedMap.msg'
depends on. Did you forget to specify generate_messages(DEPENDENCIES ...)?
Cannot locate message [Pose] in package [geometry_msgs] with paths
[['/home/skpro19/catkin_ws/devel/share/geometry_msgs/cmake/../msg']]
Call Stack (most recent call first):
/opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
CMakeLists.txt:29 (generate_messages)
cd /home/skpro19/catkin_ws/build/map_msgs; catkin build --get-env map_msgs | catkin env -si /usr/bin/cmake /home/skpro19/catkin_ws/src/navigation_msgs/map_msgs --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/skpro19/catkin_ws/devel/.private/map_msgs -DCMAKE_INSTALL_PREFIX=/home/skpro19/catkin_ws/install; cd -
..........................................................................
Failed << map_msgs:cmake [ Exited with code 1 ]
Failed <<< map_msgs [ 0.8 seconds ]
Abandoned <<< actionlib [ Unrelated job failed ]
Abandoned <<< adhoc_communication [ Unrelated job failed ]
Abandoned <<< beginner_tutorials [ Unrelated job failed ]
Abandoned <<< display_point [ Unrelated job failed ]
Abandoned <<< grid_map_msgs [ Unrelated job failed ]
Abandoned <<< hardware_interface [ Unrelated job failed ]
Abandoned <<< map_stitch_package [ Unrelated job failed ]
Abandoned <<< multihusky_viz [ Unrelated job failed ]
Abandoned <<< voxel_grid [ Unrelated job failed ]
Abandoned <<< rqt_controller_manager [ Unrelated job failed ]
Abandoned <<< gmapping [ Unrelated job failed ]
Abandoned <<< husky_bringup [ Unrelated job failed ]
Abandoned <<< husky_control [ Unrelated job failed ]
Abandoned <<< husky_gazebo [ Unrelated job failed ]
Abandoned <<< husky_navigation [ Unrelated job failed ]
Abandoned <<< husky_viz [ Unrelated job failed ]
Abandoned <<< nre_simmultihusky [ Unrelated job failed ]
Abandoned <<< bot_mapper [ Unrelated job failed ]
Abandoned <<< combined_robot_hw [ Unrelated job failed ]
Abandoned <<< controller_interface [ Unrelated job failed ]
Abandoned <<< controller_manager [ Unrelated job failed ]
Abandoned <<< controller_manager_tests [ Unrelated job failed ]
Abandoned <<< combined_robot_hw_tests [ Unrelated job failed ]
Abandoned <<< husky_base [ Unrelated job failed ]
Abandoned <<< joint_limits_interface [ Unrelated job failed ]
Abandoned <<< map_merger [ Unrelated job failed ]
Abandoned <<< gazebo_ros [ Unrelated job failed ]
Abandoned <<< grid_map_ros [ Unrelated job failed ]
Abandoned <<< grid_map_filters [ Unrelated job failed ]
Abandoned <<< grid_map_loader [ Unrelated job failed ]
Abandoned <<< grid_map_pcl [ Unrelated job failed ]
Abandoned <<< grid_map_rviz_plugin [ Unrelated job failed ]
Abandoned <<< grid_map_visualization [ Unrelated job failed ]
Abandoned <<< grid_map_demos [ Unrelated job failed ]
Abandoned <<< tf2 [ Unrelated job failed ]
Abandoned <<< map_server [ Unrelated job failed ]
Abandoned <<< tf2_bullet [ Unrelated job failed ]
Abandoned <<< tf2_eigen [ Unrelated job failed ]
Abandoned <<< tf2_py [ Unrelated job failed ]
Abandoned <<< tf2_ros [ Unrelated job failed ]
Abandoned <<< gazebo_plugins [ Unrelated job failed ]
Abandoned <<< tf2_geometry_msgs [ Unrelated job failed ]
Abandoned <<< amcl [ Unrelated job failed ]
Abandoned <<< fake_localization [ Unrelated job failed ]
Abandoned <<< multirobot_map_merge [ Unrelated job failed ]
Abandoned <<< robot_localization [ Unrelated job failed ]
Abandoned <<< robot_localization_243 [ Unrelated job failed ]
Abandoned <<< tf2_kdl [ Unrelated job failed ]
Abandoned <<< robot_state_publisher [ Unrelated job failed ]
Abandoned <<< test_tf2 [ Unrelated job failed ]
Abandoned <<< tf2_sensor_msgs [ Unrelated job failed ]
Abandoned <<< tf2_tools [ Unrelated job failed ]
Abandoned <<< transmission_interface [ Unrelated job failed ]
Abandoned <<< gazebo_ros_control [ Unrelated job failed ]
Abandoned <<< multihusky_gazebo [ Unrelated job failed ]
Abandoned <<< costmap_2d [ Unrelated job failed ]
Abandoned <<< explore_lite [ Unrelated job failed ]
Abandoned <<< grid_map_costmap_2d [ Unrelated job failed ]
Abandoned <<< nav_core [ Unrelated job failed ]
Abandoned <<< base_local_planner [ Unrelated job failed ]
Abandoned <<< carrot_planner [ Unrelated job failed ]
Abandoned <<< clear_costmap_recovery [ Unrelated job failed ]
Abandoned <<< dwa_local_planner [ Unrelated job failed ]
Abandoned <<< move_slow_and_clear [ Unrelated job failed ]
Abandoned <<< navfn [ Unrelated job failed ]
Abandoned <<< global_planner [ Unrelated job failed ]
Abandoned <<< polygon_layer [ Unrelated job failed ]
Abandoned <<< exploration_server [ Unrelated job failed ]
Abandoned <<< frontier_exploration [ Unrelated job failed ]
Abandoned <<< rotate_recovery [ Unrelated job failed ]
Abandoned <<< move_base [ Unrelated job failed ]
Abandoned <<< dynamic_map_matcher_ros [ Unrelated job failed ]
Abandoned <<< et_exploration_robot [ Unrelated job failed ]
Abandoned <<< explorer [ Unrelated job failed ]
Abandoned <<< my_explore_lite [ Unrelated job failed ]
Abandoned <<< prometheus_frontier_explorer [ Unrelated job failed ]
Finished <<< grid_map_cv [ 0.5 seconds ]
__________________________________________________________________________
Errors << autonomous_mapping_package:cmake /home/skpro19/catkin_ws/logs/autonomous_mapping_package/build.cmake.004.log
CMake Error at /home/skpro19/catkin_ws/build/autonomous_mapping_package/cmake/autonomous_mapping_package-genmsg.cmake:3 (message):
Could not find messages which
'/home/skpro19/catkin_ws/src/autonomous_mapping_package/msg/Twist.msg'
depends on. Did you forget to specify generate_messages(DEPENDENCIES ...)?
Cannot locate message [Vector3] in package [geometry_msgs] with paths
[['/home/skpro19/catkin_ws/devel/share/geometry_msgs/cmake/../msg']]
Call Stack (most recent call first):
/opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
CMakeLists.txt:71 (generate_messages)
cd /home/skpro19/catkin_ws/build/autonomous_mapping_package; catkin build --get-env autonomous_mapping_package | catkin env -si /usr/bin/cmake /home/skpro19/catkin_ws/src/autonomous_mapping_package --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/skpro19/catkin_ws/devel/.private/autonomous_mapping_package -DCMAKE_INSTALL_PREFIX=/home/skpro19/catkin_ws/install; cd -
..........................................................................
Failed << autonomous_mapping_package:cmake [ Exited with code 1 ]
Failed <<< autonomous_mapping_package [ 0.9 seconds ]
__________________________________________________________________________
Errors << exploration_msgs:cmake /home/skpro19/catkin_ws/logs/exploration_msgs/build.cmake.003.log
CMake Error at /home/skpro19/catkin_ws/build/exploration_msgs/cmake/exploration_msgs-genmsg.cmake:3 (message):
Could not find messages which
'/home/skpro19/catkin_ws/devel/.private/exploration_msgs/share/exploration_msgs/msg/ExploreAction.msg'
depends on. Did you forget to specify generate_messages(DEPENDENCIES ...)?
Cannot locate message [PolygonStamped] in package [geometry_msgs] with
paths [['/home/skpro19/catkin_ws/devel/share/geometry_msgs/cmake/../msg']]
Call Stack (most recent call first):
/opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
CMakeLists.txt:22 (generate_messages)
cd /home/skpro19/catkin_ws/build/exploration_msgs; catkin build --get-env exploration_msgs | catkin env -si /usr/bin/cmake /home/skpro19/catkin_ws/src/frontier_exploration/exploration_msgs --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/skpro19/catkin_ws/devel/.private/exploration_msgs -DCMAKE_INSTALL_PREFIX=/home/skpro19/catkin_ws/install; cd -
..........................................................................
Failed << exploration_msgs:cmake [ Exited with code 1 ]
Failed <<< exploration_msgs [ 0.9 seconds ]
__________________________________________________________________________
Errors << gazebo_msgs:cmake /home/skpro19/catkin_ws/logs/gazebo_msgs/build.cmake.003.log
CMake Error at /home/skpro19/catkin_ws/build/gazebo_msgs/cmake/gazebo_msgs-genmsg.cmake:3 (message):
Could not find messages which
'/home/skpro19/catkin_ws/src/gazebo_ros_pkgs/gazebo_msgs/msg/ContactsState.msg'
depends on. Did you forget to specify generate_messages(DEPENDENCIES ...)?
Cannot locate message [Wrench] in package [geometry_msgs] with paths
[['/home/skpro19/catkin_ws/devel/share/geometry_msgs/cmake/../msg']]
Call Stack (most recent call first):
/opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
CMakeLists.txt:55 (generate_messages)
cd /home/skpro19/catkin_ws/build/gazebo_msgs; catkin build --get-env gazebo_msgs | catkin env -si /usr/bin/cmake /home/skpro19/catkin_ws/src/gazebo_ros_pkgs/gazebo_msgs --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/skpro19/catkin_ws/devel/.private/gazebo_msgs -DCMAKE_INSTALL_PREFIX=/home/skpro19/catkin_ws/install; cd -
..........................................................................
Failed << gazebo_msgs:cmake [ Exited with code 1 ]
Failed <<< gazebo_msgs [ 0.9 seconds ]
__________________________________________________________________________
Errors << move_base_msgs:cmake /home/skpro19/catkin_ws/logs/move_base_msgs/build.cmake.005.log
CMake Error at /home/skpro19/catkin_ws/build/move_base_msgs/cmake/move_base_msgs-genmsg.cmake:3 (message):
Could not find messages which
'/home/skpro19/catkin_ws/src/navigation_msgs/move_base_msgs/msg/RecoveryStatus.msg'
depends on. Did you forget to specify generate_messages(DEPENDENCIES ...)?
Cannot locate message [PoseStamped] in package [geometry_msgs] with paths
[['/home/skpro19/catkin_ws/devel/share/geometry_msgs/cmake/../msg']]
Call Stack (most recent call first):
/opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
CMakeLists.txt:27 (generate_messages)
cd /home/skpro19/catkin_ws/build/move_base_msgs; catkin build --get-env move_base_msgs | catkin env -si /usr/bin/cmake /home/skpro19/catkin_ws/src/navigation_msgs/move_base_msgs --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/skpro19/catkin_ws/devel/.private/move_base_msgs -DCMAKE_INSTALL_PREFIX=/home/skpro19/catkin_ws/install; cd -
..........................................................................
Failed << move_base_msgs:cmake [ Exited with code 1 ]
Failed <<< move_base_msgs [ 0.9 seconds ]
__________________________________________________________________________
Errors << tf2_msgs:cmake /home/skpro19/catkin_ws/logs/tf2_msgs/build.cmake.003.log
CMake Error at /home/skpro19/catkin_ws/build/tf2_msgs/cmake/tf2_msgs-genmsg.cmake:3 (message):
Could not find messages which
'/home/skpro19/catkin_ws/src/geometry2/tf2_msgs/msg/TFMessage.msg' depends
on. Did you forget to specify generate_messages(DEPENDENCIES ...)?
Cannot locate message [TransformStamped] in package [geometry_msgs] with
paths [['/home/skpro19/catkin_ws/devel/share/geometry_msgs/cmake/../msg']]
Call Stack (most recent call first):
/opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
CMakeLists.txt:11 (generate_messages)
cd /home/skpro19/catkin_ws/build/tf2_msgs; catkin build --get-env tf2_msgs | catkin env -si /usr/bin/cmake /home/skpro19/catkin_ws/src/geometry2/tf2_msgs --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/skpro19/catkin_ws/devel/.private/tf2_msgs -DCMAKE_INSTALL_PREFIX=/home/skpro19/catkin_ws/install; cd -
..........................................................................
Failed << tf2_msgs:cmake [ Exited with code 1 ]
Failed <<< tf2_msgs [ 0.8 seconds ]
Finished <<< teleop_twist_keyboard [ 1.9 seconds ]
[build] Summary: 13 of 95 packages succeeded.
[build] Ignored: 10 packages were skipped or are blacklisted.
[build] Warnings: None.
[build] Abandoned: 76 packages were abandoned.
[build] Failed: 6 packages failed.
[build] Runtime: 3.6 seconds total.
[build] Note: Workspace packages have changed, please re-source setup files to use them.
Asked by skpro19 on 2021-05-02 04:52:16 UTC
Answers
If you are building in catkin_ws
, you don't need to include the catkin build
will do. I would suggest you first execute catkin clean
and then do catkin build
.
Asked by TK27 on 2021-05-02 06:53:16 UTC
Comments
This doesn't work. Most of the packages are producing an error on running catkin build
.
Asked by skpro19 on 2021-05-02 07:09:09 UTC
@skpro19 Was it working before you deleted the build folder? The error message seems like you have issues with generating messages and other stuff.
Asked by TK27 on 2021-05-02 07:44:45 UTC
Yes. It was working just fine.
Asked by skpro19 on 2021-05-02 08:07:54 UTC
Comments
If I create a new
catkin
workspace and move the package files from inside thecatkin_ws/src
folder to the new catkin workspace'ssrc
folder, I am build to those packages. This is strange.Asked by skpro19 on 2021-05-02 07:15:17 UTC
@skpro19 well that's solved then haha....just use that new workspace.
Asked by TK27 on 2021-05-02 07:47:49 UTC
Actually, I am not able to build the packages in the new catkin_ws.
Asked by skpro19 on 2021-05-02 07:54:50 UTC
I'm sorry to have to do this for something so seemingly unimportant, but please don't post screenshots of terminal text in question on ROS Answers. It's all text, so there is no need. Just copy-paste the text from the terminal into your question text. Do make sure to format it properly by selecting the text and pressing
ctrl+k
(or clicking the Preformatted Text button (the one with101010
on it)).You don't need to post a new question, just edit your curent one. You can use the
edit
button/link for this.After you replace the screenshot with the error message itself, we can re-open your question.
And @skpro19: you've been around for some time now, so this should not be new to you.
Asked by gvdhoorn on 2021-05-02 08:17:38 UTC
@gvdhoom I have edited my question to make the changes suggested by you.
Asked by skpro19 on 2021-05-02 08:28:06 UTC
All the errors pertain to
geometry_msgs
, which you appear to have built from source. Have you modified that package since it was last built? Also, can you please confirm whether you've triedcatkin clean
before building everything again?Asked by tryan on 2021-05-02 18:55:07 UTC
Can you try to do
catkin clean --all -y
in your catkin_ws and try again to build the workspace.Asked by aarsh_t on 2021-05-02 21:01:17 UTC
@tryan I didn't modify that package. I did trying
catkin clean
before building everyting again.Asked by skpro19 on 2021-05-02 21:55:55 UTC
@aarsh_t I am getting the same errors.
Asked by skpro19 on 2021-05-02 21:56:34 UTC
When I try to create a new catkin workspace and build the packages there, most of the errors are related to ros not working with C++.
Asked by skpro19 on 2021-05-03 07:55:39 UTC
@tryan I did manage to get rid of the erros related to
geometry_msgs
by rebuilding thegeometry_msgs
package from the source. However, I am still getting a lot of errors. Most of the erros are on the following lines -Asked by skpro19 on 2021-05-04 04:06:41 UTC
This error might also be helpful -
Asked by skpro19 on 2021-05-04 04:16:50 UTC
Can you post the output of
catkin config
in your new workspace?The fact that references to
ros::NodeHandle
,ros::Publisher
, etc. are undefined suggests that ROS is not properly sourced. It may be worth trying to reinstall ROS if we can't get your workspace sorted. Out of curiosity, is there a particular reason you're building so many packages from source rather than installing them viaapt
?Asked by tryan on 2021-05-04 10:33:50 UTC
If you have dependencies in packages under
src
, you may need to runsource devel/setup.bash
. How about this?Asked by miura on 2021-05-07 09:19:07 UTC
@tryan Should one prefer using
apt
over building fromsource
? I usually build from source as it allows to clearly see the all the packages at one place i.e inside mycatkin
workspace.Asked by skpro19 on 2021-05-11 13:02:19 UTC
@skpro19: yes. See #q320046.
Asked by gvdhoorn on 2021-05-11 13:09:49 UTC