【问题标题】:Error When Importing ROS Projects & Workspace in CLion在 CLion 中导入 ROS 项目和工作区时出错
【发布时间】:2020-08-30 10:24:59
【问题描述】:

我想让 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?

【问题讨论】:

    标签: bash ubuntu ros clion


    【解决方案1】:

    我通过执行以下操作设法解决了这个问题,但请确保您事先为 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-05
      • 1970-01-01
      相关资源
      最近更新 更多