Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 导入ROS项目时出错&;CLion中的工作空间_Bash_Ubuntu_Ros_Clion - Fatal编程技术网

Bash 导入ROS项目时出错&;CLion中的工作空间

Bash 导入ROS项目时出错&;CLion中的工作空间,bash,ubuntu,ros,clion,Bash,Ubuntu,Ros,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

我想让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_配置文件中找到了此位置,如下所示:

# 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_配置文件

现在,当我尝试在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_配置文件,以便它可以找到柳絮?

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