ROS的工作空间创建

scc18@ubuntu:~$ mkdir ros_ws
scc18@ubuntu:~$ cd ros_ws/
scc18@ubuntu:~/ros_ws$ mkdir src
scc18@ubuntu:~/ros_ws$ cd src
scc18@ubuntu:~/ros_ws/src$ catkin_init_workspace
Creating symlink "/home/scc18/ros_ws/src/CMakeLists.txt" pointing to "/opt/ros/melodic/share/catkin/cmake/toplevel.cmake"
scc18@ubuntu:~/ros_ws/src$ cd ..
scc18@ubuntu:~/ros_ws$ catkin_make
Base path: /home/scc18/ros_ws
Source space: /home/scc18/ros_ws/src
Build space: /home/scc18/ros_ws/build
Devel space: /home/scc18/ros_ws/devel
Install space: /home/scc18/ros_ws/install
####
#### Running command: "cmake /home/scc18/ros_ws/src -DCATKIN_DEVEL_PREFIX=/home/scc18/ros_ws/devel -DCMAKE_INSTALL_PREFIX=/home/scc18/ros_ws/install -G Unix Makefiles" in "/home/scc18/ros_ws/build"
####
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CATKIN_DEVEL_PREFIX: /home/scc18/ros_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2")
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/scc18/ros_ws/build/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- Configuring done
-- Generating done
-- Build files have been written to: /home/scc18/ros_ws/build
####
#### Running command: "make -j2 -l2" in "/home/scc18/ros_ws/build"
####
scc18@ubuntu:~/ros_ws$ catkin_make install
Base path: /home/scc18/ros_ws
Source space: /home/scc18/ros_ws/src
Build space: /home/scc18/ros_ws/build
Devel space: /home/scc18/ros_ws/devel
Install space: /home/scc18/ros_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/scc18/ros_ws/build"
####
####
#### Running command: "make install -j2 -l2" in "/home/scc18/ros_ws/build"
####
Install the project...
-- Install configuration: ""
-- Installing: /home/scc18/ros_ws/install/_setup_util.py
-- Installing: /home/scc18/ros_ws/install/env.sh
-- Installing: /home/scc18/ros_ws/install/setup.bash
-- Installing: /home/scc18/ros_ws/install/local_setup.bash
-- Installing: /home/scc18/ros_ws/install/setup.sh
-- Installing: /home/scc18/ros_ws/install/local_setup.sh
-- Installing: /home/scc18/ros_ws/install/setup.zsh
-- Installing: /home/scc18/ros_ws/install/local_setup.zsh
-- Installing: /home/scc18/ros_ws/install/.rosinstall
scc18@ubuntu:~/ros_ws$ source devel/setup.bash
scc18@ubuntu:~/ros_ws$ cd src
scc18@ubuntu:~/ros_ws/src$ catkin_create_pkg test std_msgs rospy roscpp
Created file test/CMakeLists.txt
Created file test/package.xml
Created folder test/include/test
Created folder test/src
Successfully created files in /home/scc18/ros_ws/src/test. Please adjust the values in package.xml.
scc18@ubuntu:~/ros_ws/src$ ls
CMakeLists.txt  test
scc18@ubuntu:~/ros_ws/src$ cd test/
scc18@ubuntu:~/ros_ws/src/test$ ls
CMakeLists.txt  include  package.xml  src
scc18@ubuntu:~/ros_ws/src/test$ cd ..
scc18@ubuntu:~/ros_ws/src$ cd ..
scc18@ubuntu:~/ros_ws$ catkin_make
Base path: /home/scc18/ros_ws
Source space: /home/scc18/ros_ws/src
Build space: /home/scc18/ros_ws/build
Devel space: /home/scc18/ros_ws/devel
Install space: /home/scc18/ros_ws/install
####
#### Running command: "cmake /home/scc18/ros_ws/src -DCATKIN_DEVEL_PREFIX=/home/scc18/ros_ws/devel -DCMAKE_INSTALL_PREFIX=/home/scc18/ros_ws/install -G Unix Makefiles" in "/home/scc18/ros_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/scc18/ros_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/scc18/ros_ws/devel;/opt/ros/melodic
-- This workspace overlays: /home/scc18/ros_ws/devel;/opt/ros/melodic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2")
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/scc18/ros_ws/build/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17")
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - test
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'test'
-- ==> add_subdirectory(test)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/scc18/ros_ws/build
####
#### Running command: "make -j2 -l2" in "/home/scc18/ros_ws/build"
####
scc18@ubuntu:~/ros_ws$ catkin_make install
Base path: /home/scc18/ros_ws
Source space: /home/scc18/ros_ws/src
Build space: /home/scc18/ros_ws/build
Devel space: /home/scc18/ros_ws/devel
Install space: /home/scc18/ros_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/scc18/ros_ws/build"
####
####
#### Running command: "make install -j2 -l2" in "/home/scc18/ros_ws/build"
####
Install the project...
-- Install configuration: ""
-- Installing: /home/scc18/ros_ws/install/_setup_util.py
-- Up-to-date: /home/scc18/ros_ws/install/env.sh
-- Up-to-date: /home/scc18/ros_ws/install/setup.bash
-- Up-to-date: /home/scc18/ros_ws/install/local_setup.bash
-- Up-to-date: /home/scc18/ros_ws/install/setup.sh
-- Up-to-date: /home/scc18/ros_ws/install/local_setup.sh
-- Up-to-date: /home/scc18/ros_ws/install/setup.zsh
-- Up-to-date: /home/scc18/ros_ws/install/local_setup.zsh
-- Up-to-date: /home/scc18/ros_ws/install/.rosinstall
-- Installing: /home/scc18/ros_ws/install/lib/pkgconfig/test.pc
-- Installing: /home/scc18/ros_ws/install/share/test/cmake/testConfig.cmake
-- Installing: /home/scc18/ros_ws/install/share/test/cmake/testConfig-version.cmake
-- Installing: /home/scc18/ros_ws/install/share/test/package.xml

简单理解

mkdir filename/src

这句话就是在创建一个简单的文件夹,目前在创建之后,并没有任何的意义,但是如果我们进行rosinit的操作之后就会变成一个工作空间。

catkin_init_workspace

这句话必须要在src文件目录下使用,这样会将src下改变成为一个工作空间。

catkin_make

这句话要求在ros的根目录,也就是我们创建的filename那个文件夹。(具体叫啥名自己看着办)。这样就是一个编译,其实意思跟我们的C++的编译类似。但是我们现在编译没有啥用处,就是编译了一个空项目。

catkin_make install

这句话会生成一个install文件夹,但是也没啥用,以后会有的。现在就是先试试,看看文件有啥问题没。

catkin_create_pkg

catkin_create_pkg test std_msgs rospy roscpp 一般来说的话就是这么去写,但是其实这句话的真正含义是,创建一个pkg,叫做test,然后倒入ros基本的信息发布包,以及python包和C++包。

source devel/setup.bash

这句话就是设置一下环境变量。要注意的是devel是在我们filename的文件夹下面的。

结尾

这就是ROS创建一个工作空间的简单操作,我觉得没什么难度,只要好好多练习,这些都属于基本功。用完删除,再创建一个也无妨。

ROS快速入门第一讲——ROS的工作空间创建相关推荐

  1. js 嵌入php_PHP快速入门第一讲:什么是PHP

    快速入门第一步:了解语言. 要学习先了解.下面我来介绍一下PHP语言.首先我们来看最官方的解释[www.php.net]:PHP("PHP: Hypertext Preprocessor&q ...

  2. PHP快速入门第一讲:什么是PHP

    快速入门第一步:了解PHP语言 要学习先了解.下面我来介绍一下PHP语言.首先我们来看最官方的解释https://www.php.net/: PHP("PHP: Hypertext Prep ...

  3. ROS高效入门第一章 -- ROS历史与现状

    ROS介绍--历史与现状 1 资料 2 读后整理 2.1 此岸与彼岸 2.2 柳树街68号 2.3 机器人毕业舞会,PR2的缔造者,ROS的起源,ROS被OSRF托管,ROS开发者大会 2.4 ROS ...

  4. ROS机器人入门课程《ROS理论与实践》零基础教程(推荐课程)

    ROS的入门,对于纯小白的我来说很是痛苦,尤其是听完古月老师的21讲之后,更是浇灭了学习的兴趣,当时还在考虑要不要他的买课,还是算了,反正也听不懂,,,!!! 在一番挣扎之后,发现了赵虚左老师的课程, ...

  5. python快速入门精讲_Python快速入门精讲

    基础入门篇 第0章从零开始3 0.1克服编程恐惧3 0.2如何写出好程序4 0.3为什么选择Python5 0.4Python的发展和应用6 0.5一些建议8 0.6多平台搭建Python开发环境10 ...

  6. openCV4.0 C++ 快速入门30讲学习笔记(自用 代码+注释)详细版

    课程来源:哔哩哔哩 环境:OpenCV4.5.1 + VS2019 目录 002.图像色彩空间转换 003.图像对象的创建与赋值 004.图像像素的读写操作 005.图像像素的算术操作(加减乘除4种不 ...

  7. 视频教程-【吴刚大讲堂】视觉设计快速入门50讲-UI

    [吴刚大讲堂]视觉设计快速入门50讲 业内知名UID.UED.用户体验.品牌策略与创意设计师,十三年行业职业教育培训经验,业内"UI视频第一人",教学总监.视觉设计讲师. Adob ...

  8. 研究生入门第一讲 让你的研究不再迷茫

    研究生入门第一讲 让你的研究不再迷茫 我的研究生师门有一个传统,会让一个研三的师兄或师姐带新来的研一师弟师妹,时间为期两周左右,在这期间你有问题可以找他或者她.为什么说两周,因为研三有很多事情要做,比 ...

  9. Git入门第一讲:Windows版本git下载安装

    Git入门第一讲:下载安装 1.官网下载 2.安装 3.创建用户名和邮箱 1.官网下载 https://git-scm.com/ 2.安装 3.创建用户名和邮箱 这一步是必须的,需要标识上传代码的人是 ...

最新文章

  1. 【 MATLAB 】信号处理工具箱之 dct 简介及案例分析
  2. python自学教程读书导图-python机器学习基础教程读书笔记八(全书总结)
  3. CAP原理和BASE思想
  4. 博文视点大讲堂36期——让Oracle跑得更快 成功举办
  5. Eclipse 常用快捷键收集
  6. 深度学习笔记(40) YOLO
  7. 百度地图 json 区域 数据_获取百度地图可视区域范围的数据
  8. 使用Kalibr进行IMU+相机的标定
  9. 001.DIV 标签添加滚动条
  10. 最强战队 | 三维视觉、SLAM方向全球顶尖实验室汇总
  11. Delta机器人鲁棒控制仿真
  12. ABYSS genome assemble 详细用法
  13. VMWARE虚拟机使用的是此版本 VMware Workstation 不支持的硬件版本。 模块“Upgrade”启动失败。 未能启动虚拟机。
  14. Android OpenGL ES 2.0(六)--- 纹理过滤
  15. 【艾琪出品】-【福建师范大学】-福师《计算机应用基础》在线作业二参考资料正确答案
  16. php提取bing背景,使用PHP获取必应Bing每日图片
  17. adb 备份和还原apk应用数据
  18. JavaScript typeof, null, 和 undefined
  19. 类似 MS Project 的项目管理工具有哪些
  20. [翻译]跟我一起边译边学之Linux:致谢 Acknowledgments

热门文章

  1. 电脑拆机(华硕FL5900)+光驱改固态
  2. AcFun_API 之 分页读取番剧列表
  3. 同一网段分化vlan问题
  4. 工大校园邮箱申请流程
  5. JDK1.8中英文官方文档
  6. 直截了当地解释 ERC-3525 与 ERC-1155 的差别
  7. 从 Google Play 下载 APK 文件
  8. 普通云硬盘,高性能云硬盘和SSD云硬盘三者之间有什么区别?
  9. 基础——树莓派3B配置
  10. 《人性的弱点》(四)上