ros执行catkin_make显示 /opt/ros/noetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):`错误

ros在执行catkin_make时显式错误 RuntimeError: Multiple packages found with the same name
或者CMake Error at /opt/ros/noetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):

error code 1 Call Stack (most recent call first): /opt/ros/noetic/share/catkin/cmake/em_expand.cmake:25 (safe_execute_process) /opt/ros/noetic/share/catkin/cmake/catkin_workspace.cmake:35 (em_expand) CMakeLists.txt:69 (catkin_workspace) -- Configuring incomplete, errors occurred!

实际错误代码

RuntimeError: Multiple packages found with the same name "turtlebot3":
- share/turtlebot3
- turtlebot3/turtlebot3
Multiple packages found with the same name "turtlebot3_bringup":
- share/turtlebot3_bringup
- turtlebot3/turtlebot3_bringup
Multiple packages found with the same name "turtlebot3_description":
- share/turtlebot3_description
- turtlebot3/turtlebot3_description
Multiple packages found with the same name "turtlebot3_example":
- share/turtlebot3_example
- turtlebot3/turtlebot3_example
Multiple packages found with the same name "turtlebot3_msgs":
- share/turtlebot3_msgs
- turtlebot3_msgs
Multiple packages found with the same name "turtlebot3_navigation":
- share/turtlebot3_navigation
- turtlebot3/turtlebot3_navigation
Multiple packages found with the same name "turtlebot3_slam":
- share/turtlebot3_slam
- turtlebot3/turtlebot3_slam
Multiple packages found with the same name "turtlebot3_teleop":
- share/turtlebot3_teleop
- turtlebot3/turtlebot3_teleop
CMake Error at /opt/ros/noetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  
  execute_process(/home/areebpc/catkin_ws/build/catkin_generated/env_cached.sh
  "/usr/bin/python3" "/usr/lib/python3/dist-packages/em.py" "--raw-errors"
  "-F" "/home/areebpc/catkin_ws/build/catkin_generated/order_packages.py"
  "-o" "/home/areebpc/catkin_ws/build/catkin_generated/order_packages.cmake"
  "/opt/ros/noetic/share/catkin/cmake/em/order_packages.cmake.em") returned
  error code 1
Call Stack (most recent call first):
  /opt/ros/noetic/share/catkin/cmake/em_expand.cmake:25 (safe_execute_process)
  /opt/ros/noetic/share/catkin/cmake/catkin_workspace.cmake:35 (em_expand)
  CMakeLists.txt:69 (catkin_workspace)
-- Configuring incomplete, errors occurred!
See also "/home/areebpc/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/areebpc/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed*

解决方法

在路径/opt/ros/noetic/share/中找到Multiple packages found with the same name中提到的重复的工作区间、功能包,删掉就可以。

起初,我在home路径下把重复的删掉了,但是在/opt/ros/noetic/share/依然有所以catkin_make时候仍然会错误。
我的/opt/ros/noetic/share/会有一个用户的文件夹,里面会有一些和用户主目录下一模一样的文件夹,我不知道为什么会产生,总之删了就可以解决catkin_make错误的问题了。

你可能感兴趣的:(ros,c++)