在 CLion 中导入 ROS 项目和工作区时出错
Error When Importing ROS Projects & Workspace in CLion
我想让 CLion 尝试使用 ROS 源代码。我创建了一个 ROS 工作区并具有以下文件夹结构:
joesan@joesan-InfinityBook-S-14-v5:~/Projects/Private/ros-projects$ cd catkin_ws/
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:27 2020 .
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:10 2020 ..
.rw-rw-r-- joesan joesan 98 B Sun Aug 30 10:48:27 2020 .catkin_workspace
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:27 2020 build
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:26 2020 devel
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 12:13:50 2020 src
joesan@joesan-InfinityBook-S-14-v5:~/Projects/Private/ros-projects/catkin_ws$
我在 .bash_profile 中找到了这个位置,如下所示:
# Dynamically source all setup.bash files from multiple catkin ros workspaces
find /home/joesan/Projects/Private/ros-projects -wholename '*/devel/setup.bash' | xargs source
然后我从我的 .bashrc
中获取 .bash_profile
现在,当我尝试在 CLion 中打开项目时,我看到以下错误:
CMake Error at CMakeLists.txt:65 (message):
find_package(catkin) failed. catkin was neither found in the workspace nor
in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was
sourced before.
我通过我创建的桌面快捷方式条目启动 CLion。我如何让 CLion 知道这个 .bash_profile 以便它可以找到 catkin?
我通过执行以下操作设法解决了这个问题,但请确保您事先为 Jetbrains CLion 创建了一个桌面条目!
打开位于 .local 文件夹中的 jetbrains-clion.desktop:
~/.local/share/applications/jetbrains-clion.desktop
在此桌面条目中,将 Exec=
行修改为:
Exec=bash -i -c "/opt/softwares/clion-2020.2.1/bin/clion.sh" %f
我想让 CLion 尝试使用 ROS 源代码。我创建了一个 ROS 工作区并具有以下文件夹结构:
joesan@joesan-InfinityBook-S-14-v5:~/Projects/Private/ros-projects$ cd catkin_ws/
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:27 2020 .
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:10 2020 ..
.rw-rw-r-- joesan joesan 98 B Sun Aug 30 10:48:27 2020 .catkin_workspace
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:27 2020 build
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:26 2020 devel
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 12:13:50 2020 src
joesan@joesan-InfinityBook-S-14-v5:~/Projects/Private/ros-projects/catkin_ws$
我在 .bash_profile 中找到了这个位置,如下所示:
# Dynamically source all setup.bash files from multiple catkin ros workspaces
find /home/joesan/Projects/Private/ros-projects -wholename '*/devel/setup.bash' | xargs source
然后我从我的 .bashrc
中获取 .bash_profile现在,当我尝试在 CLion 中打开项目时,我看到以下错误:
CMake Error at CMakeLists.txt:65 (message):
find_package(catkin) failed. catkin was neither found in the workspace nor
in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was
sourced before.
我通过我创建的桌面快捷方式条目启动 CLion。我如何让 CLion 知道这个 .bash_profile 以便它可以找到 catkin?
我通过执行以下操作设法解决了这个问题,但请确保您事先为 Jetbrains CLion 创建了一个桌面条目!
打开位于 .local 文件夹中的 jetbrains-clion.desktop:
~/.local/share/applications/jetbrains-clion.desktop
在此桌面条目中,将 Exec=
行修改为:
Exec=bash -i -c "/opt/softwares/clion-2020.2.1/bin/clion.sh" %f