sudo apt-get install tree
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列软件包是自动安装的并且现在不需要了:
snapd-login-service
使用'sudo apt autoremove'来卸载它(它们)。
下列【新】软件包将被安装:
tree
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
需要下载 40.6 kB 的归档。
解压缩后会消耗 138 kB 的额外空间。
获取:1 http://mirrors.aliyun.com/ubuntu xenial/universe amd64 tree amd64 1.7.0-3 [40.6 kB]
已下载 40.6 kB,耗时 0秒 (199 kB/s)
正在选中未选择的软件包 tree。
(正在读取数据库 ... 系统当前共安装有 312974 个文件和目录。)
正准备解包 .../tree_1.7.0-3_amd64.deb ...
正在解包 tree (1.7.0-3) ...
正在处理用于 man-db (2.7.5-1) 的触发器 ...
正在设置 tree (1.7.0-3) ...
在catkin_ws目录下操作。
tree -L 3是展示3级目录
catkin_ws$ tree -L 3
.
├── build
│ ├── atomic_configure
│ │ ├── env.sh
│ │ ├── local_setup.bash
│ │ ├── local_setup.sh
│ │ ├── local_setup.zsh
│ │ ├── setup.bash
│ │ ├── setup.sh
│ │ ├── _setup_util.py
│ │ └── setup.zsh
│ ├── catkin
│ │ └── catkin_generated
│ ├── catkin_generated
│ │ ├── env_cached.sh
│ │ ├── generate_cached_setup.py
│ │ ├── installspace
│ │ ├── order_packages.cmake
│ │ ├── order_packages.py
│ │ ├── setup_cached.sh
│ │ └── stamps
│ ├── CATKIN_IGNORE
│ ├── catkin_make.cache
│ ├── CMakeCache.txt
│ ├── CMakeFiles
│ │ ├── 3.5.1
│ │ ├── clean_test_results.dir
│ │ ├── cmake.check_cache
│ │ ├── CMakeDirectoryInformation.cmake
│ │ ├── CMakeError.log
│ │ ├── CMakeOutput.log
│ │ ├── CMakeRuleHashes.txt
│ │ ├── CMakeTmp
│ │ ├── download_extra_data.dir
│ │ ├── doxygen.dir
│ │ ├── feature_tests.bin
│ │ ├── feature_tests.c
│ │ ├── feature_tests.cxx
│ │ ├── Makefile2
│ │ ├── Makefile.cmake
│ │ ├── progress.marks
│ │ ├── run_tests.dir
│ │ ├── TargetDirectories.txt
│ │ └── tests.dir
│ ├── cmake_install.cmake
│ ├── CTestConfiguration.ini
│ ├── CTestCustom.cmake
│ ├── CTestTestfile.cmake
│ ├── gtest
│ │ ├── CMakeFiles
│ │ ├── cmake_install.cmake
│ │ ├── CTestTestfile.cmake
│ │ ├── gtest
│ │ └── Makefile
│ ├── Makefile
│ └── test_results
├── devel
│ ├── cmake.lock
│ ├── env.sh
│ ├── lib
│ ├── local_setup.bash
│ ├── local_setup.sh
│ ├── local_setup.zsh
│ ├── setup.bash
│ ├── setup.sh
│ ├── _setup_util.py
│ └── setup.zsh
└── src
└── CMakeLists.txt -> /opt/ros/kinetic/share/catkin/cmake/toplevel.cmake
22 directories, 46 files
在catkin_ws/src目录下操作 新创建一个test1的包。catkin_create_pkg是命令
~/catkin_ws/src$ catkin_create_pkg test1
Created file test1/package.xml
Created file test1/CMakeLists.txt
Successfully created files in /home/wlzxzq/catkin_ws/src/test1. Please adjust the values in package.xml.
以上为创建了一个空的pkg。下面创建一个有依赖的包(进行指定),依赖的有c++、py、通信、导航等
wlzxzq@ubuntu:~/catkin_ws/src$ catkin_create_pkg test2 roscpp rospy std_msgs nav_msgs
Created file test2/CMakeLists.txt
Created file test2/package.xml
Created folder test2/include/test2
Created folder test2/src
Successfully created files in /home/wlzxzq/catkin_ws/src/test2. Please adjust the values in package.xml.
wlzxzq@ubuntu:~/catkin_ws/src$ tree
.
├── CMakeLists.txt -> /opt/ros/kinetic/share/catkin/cmake/toplevel.cmake
├── test1
│ ├── CMakeLists.txt
│ └── package.xml
└── test2
├── CMakeLists.txt //自动增加了依赖信息
├── include
│ └── test2
├── package.xml //自动增加了依赖信息
└── src
5 directories, 5 files
将别人的案例、历程、项目都放置于catkin_ws/src目录下,同时,一定要把依赖安装,安装是要求回到catkin_ws目录下面继续宁rosdep install
rosdep install --from-paths src --ignore-src --rosdistro=kinetic -y
测试rospack list
rospack list | grep catkin_ws
rospack find test2 直接定位包位置
重德智能的基础学习代码。将其放置于/src/目录下面
git clone https://github.com/DroidAITech/ROS-Academy-for-Beginners.git
正克隆到 'ROS-Academy-for-Beginners'...
remote: Enumerating objects: 1571, done.
20% (316/1571), 4.94 MiB | 58.00 KiB/s
回到catkin_ws/目录下,catkin_make 编译完成
要对系统source以下:source ~/.bashrc
找一下安装的都是哪些包。
rospack list | grep catkin_ws
rosls
rosls topic_demo/
rosed topic_demo CMakeList.txt