注意:我正在使用 Oracle virtualbox 中的 Ubuntu 18.04.4 LTS (Bionic),
以下是我正在做的事情
cd catkin_ws
然后我创建了包
roscreate-pkg test std_msgs rospy roscpp
然后cd ..
做catkin_make
然后我进入测试文件夹并执行
make eclipse-project
但它会产生以下错误
mv Makefile Makefile.ros
if ! (cmake -G"Eclipse CDT4 - Unix Makefiles" -Wno-dev . && rm Makefile && rm CMakeCache.txt && rm -rf CMakeFiles); then mv Makefile.ros Makefile && echo "**ERROR building Eclipse project!**" && false; fi
-- Eclipse version is set to 3.6 (Helios). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.
[rosbuild] Building package tests
[rosbuild] Error from directory check: /opt/ros/melodic/share/ros/core/rosbuild/bin/check_same_directories.py /home/nis/catkin_ws/tests
1
Traceback (most recent call last):
File "/opt/ros/melodic/share/ros/core/rosbuild/bin/check_same_directories.py", line 46, in <module>
raise Exception
Exception
CMake Error at /opt/ros/melodic/share/ros/core/rosbuild/private.cmake:99 (message):
[rosbuild] rospack found package "tests" at "", but the current directory
is "/home/nis/catkin_ws/tests". You should double-check your
ROS_PACKAGE_PATH to ensure that packages are found in the correct
precedence order.
Call Stack (most recent call first):
/opt/ros/melodic/share/ros/core/rosbuild/public.cmake:177 (_rosbuild_check_package_location)
CMakeLists.txt:12 (rosbuild_init)
-- Configuring incomplete, errors occurred!
See also "/home/nis/catkin_ws/tests/CMakeFiles/CMakeOutput.log".
**ERROR building Eclipse project!**
/opt/ros/melodic/share/mk/cmake.mk:45: recipe for target 'eclipse-project' failed
make: *** [eclipse-project] Error 1