在CLion中设置ROS软件包 [英] Setting up ROS package in CLion

查看:460
本文介绍了在CLion中设置ROS软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用CLion(C ++ IDE)编辑ROS软件包。我可以通过打开 CMakeLists.txt 文件来打开一个包。但是,我得到一个错误

I am using CLion (C++ IDE) for editing a ROS package. I was able to open a package by opening the CMakeLists.txt file. But, I get an error,


FATAL_ERROR find_package(catkin)失败。在工作区和CMAKE_PREFIX_PATH中都找不到catkin。原因之一可能是
no ROS setup.sh是在

"FATAL_ERROR "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中 make 项目(如果是,该怎么做)还是必须 catkin_make 在单独的终端中?

How do I solve this problem? Will I be able to make the project in CLion (If so, how do I) after I make changes to the code or do I have to catkin_make in a separate terminal?

推荐答案

尝试以下操作(对于Linux):

Try this (for Linux):


  1. 打开命令行

  1. Open a command line

在您的计算机上运行 catkin_make 包。

Run catkin_make on your package.

source 您的 catkin_workspace / devel / setup.bash 文件,例如 source〜 /my_dev_folder/catkin_ws/devel/setup.bash

[CLion安装目录] /bin/clion.sh 例如 cd〜/ Downloads / clion-1.2.4 / bin&& ./clion.sh

然后,CLion应该首先通过setup.bash文件设置的本地环境变量来了解您的catkin工作区中的软件包。

CLion should then start with knowledge about the packages in your catkin workspace, through the local environment variables set up by the setup.bash file.

这篇关于在CLion中设置ROS软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆