当前位置:网站首页>[ROS] (01) Create ROS workspace
[ROS] (01) Create ROS workspace
2022-08-02 14:18:00 【CynalFly】
Articles are only study notes during personal study,主要参考ROS教程1.
1. 创建catkin工作空间
CatkinA workspace is a folder,可以在其中修改、构建和安装 catkin 包.
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make
在运行上述命令后,在catkin_wsunder the workspacebuild
、devel
、src
The three directory folders(这3个catkinBuild system default).
build
(Build Space):catkin(CMake)cache information and other middlewaredevel
(Development Space):生成目标文件(包括头文件、动态链接库、静态链接库、可执行文件等)、环境变量src
(Source Space):ROS的catkin软件包(源码)
Tips:Some of the earlier tutorials remain
catkin_init_workspace
This initialization command,它的作用就是在catkin_ws
工作空间的src
目录下创建CMakeLists.txt
文件.但实际上catkin_make
命令包含了catkin_init_workspace
,No need to call again(当然你也可以使用,没有任何影响).
接下来设置环境变量,首先source
一下新生成的setup.*sh
文件(在develYou can see a few in the directorysetup.*sh
):
source devel/setup.bash
But the above command only works on the current terminal,This results in the need to open a new terminal every timesource
命令一下,Refresh environment variables,才能使用ROS相关命令.解决办法是,在终端中输入如下命令,So every time you open the terminal,.bashrc
会自动运行:
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
我们用 vi 编辑器打开 ~/.bashrc
文件,在文件的末尾(红色框内)This line is what we addedROS系统的环境变量,The previous line is what we createdcatkin_ws工作空间的环境变量.在终端中输入如下命令:
vi ~/.bashrc
Want to see environment variables,在终端中输入如下命令:
echo $ROS_PACKAGE_PATH
After passing the above command,The display contains those saved withROS软件包的路径,And use colons between each path(:)分隔开来.
路径PATH格式:/home/<
username
>/catkin_ws/src:/opt/ros/<distro
>/share
2. catkin工作空间结构
要查看catkin工作空间的结构,可以使用tree命令,显示文件结构,在终端中输入如下命令:
cd ~/catkin_ws
sudo apt install tree
tree
The displayed structure is shown below:
.
├── 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
│ │ └── version
│ │ └── package.cmake
│ ├── catkin_generated
│ │ ├──
......
├── 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/melodic/share/catkin/cmake/toplevel.cmake
ROS.otg. ROS教程[EB/OL]. 2020-12-22[2022-7-5]. http://wiki.ros.org/cn/ROS/Tutorials. ︎
边栏推荐
- 动手学ocr(一)
- 监管再次重拳出击,后市如何?2021-05-22
- FFmpeg 的AVCodecContext结构体详解
- ftp常用命令详解_iftop命令详解
- 【ONE·Data || Getting Started with Sorting】
- You can't accept 60% slump, there is no eligible for gain of 6000% in 2021-05-27
- AWVS工具介绍[通俗易懂]
- WeChat Mini Program-Recent Dynamic Scrolling Implementation
- Swagger 的使用
- LayoutParams的详解
猜你喜欢
The most complete ever!A collection of 47 common terms of "digital transformation", read it in seconds~
MobileNet ShuffleNet & yolov5替换backbone
Cloin 控制台乱码
yolov5改进(一) 添加注意力集中机制
第十一单元 序列化器
深度学习框架pytorch快速开发与实战chapter4
Raft协议图解,缺陷以及优化
RKMPP库快速上手--(一)RKMPP功能及使用详解
Object detection scene SSD-Mobilenetv1-FPN
未来的金融服务永远不会停歇,牛市仍将继续 2021-05-28
随机推荐
此次519暴跌的几点感触 2021-05-21
【Tensorflow】AttributeError: '_TfDeviceCaptureOp' object has no attribute '_set_device_from_string'
rpm包的卸载与安装[通俗易懂]
Sentinel源码(二)入口方法分析
网页设计(新手入门)[通俗易懂]
Flutter 实现光影变换的立体旋转效果
Supervision strikes again, what about the market outlook?2021-05-22
How to solve 1045 cannot log in to mysql server
【ROS】工控机的软件包不编译
跑yolov5又出啥问题了(1)p,r,map全部为0
第十四单元 视图集及路由
Linux:CentOS 7 安装MySQL5.7
【Tensorflow】AttributeError: module 'keras.backend' has no attribute 'tf'
关于密码加密的一点思路
动手学ocr(一)
Break the limit of file locks and use storage power to help enterprises grow new momentum
The world's largest Apache open source foundation is how it works?
php开源的客服系统_在线客服源码php
定了!就在7月30日!
网络安全第二次作业