当前位置:网站首页>Introduction to common ROS commands
Introduction to common ROS commands
2022-06-13 01:38:00 【lainegates】
Reference resources ROS Official website tutorial
List of articles
Command Completion
ROS The system is more complex , To simplify command input ,ROS Some of the tools provided by tab Complement function .
for example ,
$ roscd roscpp_tut<<< Press TAB key >>>
You'll get
$ roscd roscpp_tutorials/
Package compilation catkin***
Create a package catkin_create_pkg
Create a package , And specify dependencies
catkin_create_pkg <package_name> [depend1] [depend2] [depend3]
Build package catkin_make
catkin_make The tool should be called at the bottom cmake, It passes through CMakeLists.txt To set the compilation information .
| command | explain |
|---|---|
| catkin_make [make_targets] [-DCMAKE_VARIABLES=…] | Command style , Bottom call cmake |
| catkin_make install | Be similar to cmake install |
| catkin_make --source [my_source_dir] | Place the compiled contents of the code in the specified directory in the current directory |
Non runtime tools
Package management tools rospack = ros + pack(age)
rospack yes rosbash Part of the command set ,rospack Allows you to get information about the package , Detailed view .
| command | explain |
|---|---|
| rospack find [package_name] | Find the path where the package is located |
| rospack depends1 [package_name] | View package level dependencies ( Directly dependent packages ), With view [package_name]/package.xml Of <build_depend> Label equivalence . |
| rospack depends [package_name] | View all dependent packages ( Recursively view all dependent packages ) |
Catalog roscd = ros + cd
roscd yes rosbash Part of the command set , It allows you to switch directories directly (cd) To a package or package set .
roscdYou can only switch to those paths that are already included inROS_PACKAGE_PATHPackages in environment variables .ROS_PACKAGE_PATHThe value of is determined by (:) Separate
seeROS_PACKAGE_PATHThe path contained in :
$ echo $ROS_PACKAGE_PATH
| command | explain |
|---|---|
| roscd [locationname[/subdir]] | roscd roscpp/cmake , Enter the package cmake subdirectories |
| roscd log Enter the package log Catalog |
Catalog rosls = ros + ls
rosls yes rosbash Part of the command set , It allows you to execute directly by the package name ls command ( Instead of entering an absolute path ).
$ rosls roscpp_tutorials
Packet message protocol (rosmsg) Tools
This tool is used to view the *.msg Generated message object information
| command | explain |
|---|---|
| rosmsg show | Output message definition |
| rosmsg list | List all supported messages |
| rosmsg md5 | Output News md5 value |
| rosmsg package | Enumerate all messages supported by the package |
| rosmsg packages | List messages supported by multiple packages |
Package service agreement (rossrv) Tools
This tool is used to view the *.srv Generated message object information
| command | explain |
|---|---|
| rossrv show [srv-name] | Definition of the output service agreement |
| rossrv info [srv-name] | Equivalent to rossrv show |
| rossrv list | List all supported service agreements |
| rossrv md5 | Of the output service agreement md5 value |
| rossrv package | List all service agreements supported by the package ( Name only ) |
| rossrv packages | List the service agreements supported by multiple packages ( Name only ) |
Runtime tools
Master node roscore
Start master node
roscore
node rosnode (ros+node)
| command | explain |
|---|---|
| rosnode list | View the running node |
| rosnode info [package name] | View node status , Nodes such as rosnode info /rosout |
| rosnode cleanup | Empty nodes |
| rosnode ping [node_name] | Check the operation node |
Start node rosrun (ros+run)
rosrun Run the nodes in the software package directly according to the package name , You don't need to know the path of the package .
$ rosrun [package_name] [node_name]
for example , Run the little turtle
rosrun turtlesim turtlesim_node # function turtlesim Bag turtlesim_node node
Topic command rostopic (ros+topic)
rostopic Command tools are used to get ROS Information about the topic .
| rostopic bw | Output bandwidth |
| rostopic delay | Input delay |
| rostopic echo [topic] | Information output to the screen |
| rostopic find [topic] | Find by type topic |
| rostopic hz [topic] | Output information frequency (Hz) |
| rostopic info [topic] | Output activity topic Information about |
| rostopic list | List activities topic |
| rostopic pub [topic] [msg_type] [args] | towards [topic] Release (publish) [msg_type] Information of type information , Parameter is [args.] , See the following example |
| rostopic type [topic] | Output topic The message type of , As coordinates (x,y,z) |
| rostopic -h | see rostopic All operations supported |
| rostopic -h | see rostopic Specific instructions for operation |
towards topic Examples of publishing messages ( edition ROS Groovy )
$ rostopic pub -1 /turtle1/command_velocity turtlesim/Velocity -- 2.0 1.8
-1, The news is only released once , Such as the input-r 1, with 1Hz frequency publish Repeat message/turtle1/command_velocity,topic Nameturtlesim/Velocity, Message type--, Separator , The following are parameters of the current data type ( namely2.0 1.8)
The service command
Service is ROS Another way the system transmits information , And topic The difference is that :
- Service is like making phone calls , Yes, there is.
- topic Like watching TV , At one end , Close at one end .
Server command rosservice
| The service command | explain |
|---|---|
| rosservice list | Output information about active services |
| rosservice call [service] [args] | Call the service with the given parameters |
| rosservice type [service] | Type of output service |
| rosservice find | Find services by service type |
| rosservice uri | Output service ROSRPC uri |
Server parameters rosparam
rosparam For storage and operation ROS Parameters , Use YAML Grammar of markup language :
- 1 Integer.
- 1.0 It's floating point
- one Is string
- true It's Boolean
- [1, 2, 3] Is a list of integers
- {a: b, c: d} It's a dictionary .
| Support operation | explain |
|---|---|
| rosparam set [param_name] | Set parameters |
| rosparam get [param_name] | To obtain parameters , If write / You will get all the contents of the parameter |
| rosparam load [file_name] [namespace] | Load parameters from file |
| rosparam dump [file_name] [namespace] | Dump parameters to a file |
| rosparam delete | Delete parameters |
| rosparam list | List parameter names |
边栏推荐
- Implementation and design of JMeter interface test database assertion for CSDN salary increase technology
- Leetcode question brushing 02 linked list operation
- Leetcode question brushing 03 stack
- Golang learning essay
- Use koa to mock data and set cross domain issues
- A summary of global variables and typedef
- 如何通过受众群体定位解决实际问题?
- Anims of phaser3
- Redis usage optimization summary learning
- DFS and BFS notes (II): depth first search (implemented in C language)
猜你喜欢

Realization of flip animation

Go JWT learning summary

Simple operation of MySQL database

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

matplotlib画图中文乱码

How to solve the problems when using TV focusable to package APK in uni app

三、上传织物图片至SQL Server并提供name进行展示织物照片

C language implementation of the classic eight queens problem

MySQL connection query

Introduction to common activation functions
随机推荐
Run Presto under docker to access redis and Bi presentation
Large end storage and small end storage
np. Understanding of axis in concatenate
一种不带CPU的DPU架构:Hyperion
Detailed explanation of audience characteristics
Realization of flip animation
Alexnet implements image classification of caltech101 dataset (pytorch Implementation)
FSOs forest simulation optimization model learning notes
五、库存查询功能的完善
Work and life
MySQL performance optimization
C language implementation of the classic eight queens problem
[andoid][step pit]cts 11_ Testbootclasspathandsystemserverclasspath at the beginning of R3_ Analysis of nonduplicateclasses fail
Leetcode question brushing 06 bit operation
[wsl2] restrict wsl2 accessible hardware resources (cpu/ memory)
【软考】软件设计师知识点整理(待更新)
Minimum score of one question per day
csdn涨薪技术之Jmeter接口测试数据库断言的实现与设计
leetcode743. 网络延迟时间(中等, dijkstra)
Super complete regular expressions