不使用 ros 编译 roscpp(使用 g++) [英] Compile roscpp without ros (using g++)
问题描述
我正在尝试在不使用其余 ROS 的情况下编译 roscpp(我只需要订阅一个节点,但拥有使用旧版本 ROS 的节点,由于编译,我无法将我的程序与他的程序集成)麻烦).我从 git (https://github.com/ros/ros_comm) 下载了源代码,现在我需要编译它,但 Cmake 抛出错误:
I'm trying to compile roscpp without using the rest of ROS (I only need to subscribe to a node but the one that own that uses an old version of ROS and I couldn't integrate my program with his due to compilation troubles). I downloaded the source code from git (https://github.com/ros/ros_comm) and now I need to compile it, but Cmake throw me errors:
INFOBuilding GTest from source.
TODO: implement add_roslaunch_check() in rostest-extras.cmake.
CMake Error at CMakeLists.txt:8 (catkin_package_xml):
Unknown CMake command "catkin_package_xml".
我该如何构建它?我正在调用 cmake CMakeList.txt,但它不起作用.
How can I build it? I'm calling cmake CMakeList.txt, but it doesn't work.
推荐答案
我建议你使用 rosinstall_generator 编译你想要的包,比如roscpp.以下是步骤:
I suggest you to use rosinstall_generator to compile the package you want, such as roscpp. Here are the steps:
下载包及其依赖项:
rosinstall_generator roscpp --rosdistro <ROS_Distro that you use> --deps > roscpp_ros.rosinstall
wstool init src roscpp_ros.rosinstall -j8
rosdep install --from-path src -i -y
然后编译它:
src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
编译后的包会在文件夹install_isolated(与文件夹src同级)
The compiled packages will be in the folder install_isolated (at the same level as the folder src)
这篇关于不使用 ros 编译 roscpp(使用 g++)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!