当前位置:网站首页>Workspace for ROS
Workspace for ROS
2022-06-13 01:39:00 【lainegates】
List of articles
Reference resources
ROS official wiki— understand ROS node
ROS official wiki— understand ROS topic of conversation
ROS official wiki— understand ROS Service and parameters
In front of
ROS Logical view of
ROS Introduction to workspace
ROS Your workspace provides predefined management patterns . The schematic diagram of the workspace is as follows :
The figure includes two package, It is divided into orange and green , parallelogram Represents a code file , Square box Representative directory .
ROS The content of the workspace is divided into 4 class :
- src: Deal with the most folders , Save all the code , Each subfolder is a pakage, There will be more details later
- build: Intermediate compilation file , Unless something strange happens at compile time bug, I don't care
- devel: All generated exec/.py The catalog of , It's also ROS The system guides the directory of packages written by itself , There will be more details later
- install: When it can be published , The directory where the program is saved
src Catalog
src Each folder in the directory represents a package, Every pakage Multiple executables can be generated , Each executable is a ROS node .
Every package Contains the following :
include: Store the prepared header file , stay CMakeLists.txt Specify... When addinginclude/*.hsrc: Save the authored source file , stay CMakeLists.txt Specify... When addinginclude/*.cppsrv( Optional ): Service agreement documents*.srcWhere to save , coordination CMakeLists.txt Ofadd_service_files()Use ,Write the file name directly , Don't prefixmsg( Optional ): Service agreement documents*.msgWhere to save , coordination CMakeLists.txt Ofadd_message_files()Use ,Write the file name directly , Don't prefix
devel Catalog
This directory is usually not separate , but ROS To support c++/Python Two outputs , So put it in a separate folder , And the default is ROS System boot file . Specific include :
-setup.sh/.zsh/.bash: By different shell Called script ,source Right after ROS System The current workspace is guided in , It can be used later rosrun/roscd/… And so on package.
-local_setup.sh/.zsh/.bash: Used to call... In the current directory setup.sh
-__setup__util.py: Be similar to setup.sh, But for guiding python load
-env.sh: Environment settings for the current workspace , There is no need to manually call
-include:C++ Header Directory
-lib:c++ Compile the generated 、python Code and configuration file directory
[pkg*]:c++ The output directory of the executable , Press package Folder split[pkgconfig]:C++ External boot configuration for , Used when it is dependent on other libraries , Below is each package Provides*.pcThe configuration filepython3:python Output file directory , Provided belowsite-package, Available python External call
Create a workspace
Create directory manually
source /opt/ros/noetic/setup.sh # This item can be added to ~/.bashrc, You don't need to call every time
cd ~
mkdir catkin_ws
cd catkin_ws
mkdir src # Create a code directory under the workspace
establish package
After the following code is executed , Will press ROS Logical compilation code of workspace , But the directory is empty , Then it will be created directly build/devel/… Such as catalog , And add the corresponding configuration file
cd src
catkin_create_pkg test std_msgs # Create a package test, Dependent library is std_msgs
cd ~/catkin_ws/
catkin_make # Will compile normally , But no compiled code , Therefore, no executable program will be generated
# Must be in ROS The root directory of the workspace calls
catkin_cmake It's a compound command , Equivalent to
$ mkdir build
$ cd build
$ cmake ../src
$ make
Additional information
If you add or remove package, Be sure to carry out
$ catkin_make --force-cmake
If this command is invalid , Just delete build Catalog , Completely re execute .
follow-up
Reference resources
ROS Of Topic Create and run samples
ROS Service creation and running example of
Create the first program .
边栏推荐
- D template instance does not match declaration
- Leetcode question brushing 06 bit operation
- Set and array conversion, list, array
- Web Application & applet application deployment
- Stack stack LIFO
- Design of distributed game server
- V-inline-date, similar to Ctrip, flying pig, time selection with price
- Leetcode question brushing 04 string
- [WSL2]WSL2迁移虚拟磁盘文件ext4.vhdx
- MySQL download and installation
猜你喜欢

Stack and queue practice (C language): Demon King's language

【斯坦福计网CS144项目】Lab1: StreamReassembler

Leetcode 05 tree

谷歌加大型文字广告是什么?怎么用?

Database query user mailbox

五、库存查询功能的完善

Sliding window summary of TCP connections

Summary of various installation methods of Lab View

MySQL performance optimization

The second round of mesa
随机推荐
Note: common gadgets in project architecture
Redis usage optimization summary learning
Three paradigms of database
[从零开始学习FPGA编程-21]:进阶篇 - 架构 - VerilogHDL编码规范
C language implementation of the classic eight queens problem
pycharm add configutions
My crawler learning notes
How to solve the problem of database?
开发者来稿|AMD赛灵思中文论坛分享 - 提问的智慧
This of phaser3 add. sprite
Phaser3 load
Leetcode question brushing 06 bit operation
路径字段是什么? ——竞价广告
Install pycharm process
他山之石:a16z 的 Web3 投资版图
Getting started with phaser 3
使用Pygame创建一个简单游戏界面
STM32 3*3矩阵按键(寄存器版本)
FSOs forest simulation optimization model learning notes
[WSL2]限制WSL2可访问的硬件资源(CPU/内存)