当前位置:网站首页>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 .
边栏推荐
猜你喜欢
随机推荐
Rasa dialogue robot helpdesk (III)
如何利用您的自有数据来实现营销目标?
【斯坦福计网CS144项目】Lab1: StreamReassembler
About the proposed signature file migration to industry standard format pkcs12
Leetcode question brushing 06 bit operation
Wildcard usage of go standard library FMT
Machine learning basic SVM (support vector machine)
六、出库管理功能的实现
MySQL download and installation
Leetcode question brushing 04 string
FLIP动画实现思路
The interviewer only asked me five questions and the interview was over
How to print infinite symbol in WPS
Install pycharm process
4K sea bottom and water surface fabrication method and ocean bump displacement texture Download
[wsl2]wsl2 migrate virtual disk file ext4 vhdx
How to solve the problems when using TV focusable to package APK in uni app
[MySQL password management] - [administrator password known, unknown (forgotten), cracked]
leetcode743. Network latency (medium, Dijkstra)
项目实训(十七)---个人工作总结




![[leetcode] valid phone number Bash](/img/f8/cecb74f9d8f7c589e62e3a9a874f82.jpg)


![[Stanford Jiwang cs144 project] lab1: streamreassembler](/img/7b/fad18b68a6ee30d1dec4dad6273b98.png)

