当前位置:网站首页>Ros2 - common command line (IV)
Ros2 - common command line (IV)
2022-07-05 06:51:00 【Me and nano】
ROS2 Robot operating system
List of articles
Preface
Let's introduce ROS2 Common operation instructions in
One 、 Common command line
cd
grammar :cd < Directory path >
function : Change the working directory . If not specified “ Directory path ”, Then return to the user's home directory
pwd
grammar :pwd
function : This command shows the absolute path of the current working directory
mkdir
grammar :mkdir [ Options ] < Directory name >
function : Create a directory / Folder
ls
grammar :ls [ Options ] [ Directory name …]
function : List the contents / List of files in the folder
gedit
grammar :gedit < File name >
function : open gedit Editor edit file , If there is no such file, it will be created
mv
grammar :mv [ Options ] < Source file or directory > < Destination file or directory >
function : Rename a file or directory or move a file from one directory to another
cp
grammar :cp [ Options ] < Source file name or directory name > < Destination file name or directory name >
function : Copy a file or directory to another file or directory , Or copy multiple source files to the target directory
rm
grammar :rm [ Options ] < File name or directory name …>
function : The function of this command is to delete one or more files or directories in a directory , It can also delete a directory and all its files and subdirectories . For linked files , Just deleted the link , The original files remain unchanged
sudo
grammar :sudo [ Options ] [ Instructions ]
function : Execute instructions with the privileges of the system administrator
Two 、ROS2 The command line in
ROS2 The operation mechanism of the command line is similar to Linux identical , But all operations are integrated in one ros2 In the general order of , The first parameter in the back indicates different operation purposes , such as node Indicates the operation on the node ,topic Indicates the operation of the topic , What is the specific operation , You can also continue to follow a series of parameters .
1. Run the node program
Want to run ROS2 A node in , We can use ros2 run Command to operate , For example, we need to run turtle simulation node and keyboard control node :
ros2 run turtlesim turtlesim_node
ros2 run turtlesim turtle_teleop_key

2. View node information
Currently running ROS Which nodes are there in the system ? You can view it like this :
ros2 node list

If you are interested in a node , Add a info Sons command , You can know its details :
ros2 node info /turtlesim

3、 ... and 、 View topic information
There are topics in the current system , Use the following command to view :
ros2 topic list

I also want to see the message data in a topic , add echo Try the sub command :
ros2 topic echo /turtle1/pose

Four 、 Post topic news
ros2 topic pub --rate 1 /turtle1/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 2.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 1.8}}"

5、 ... and 、 Send service request
A turtle is too lonely , The simulator also provides a service —— Produce turtles , Let's try service invocation , Another turtle :
ros2 service call /spawn turtlesim/srv/Spawn "{x: 2, y: 2, theta: 0.2, name: ''}"

6、 ... and 、 Recording control command
There are many data in the operation of the system , If you want to record some data , How about going back to the laboratory to reproduce this data ?ROS2 Medium rosbag The function is still very easy to use , Easily record and play data :
ros2 bag record /turtle1/cmd_vel
ros2 bag play rosbag2_2022_04_11-17_35_40/rosbag2_2022_04_11-17_35_40_0.db3
summary
These instructions will be used if they are often used
边栏推荐
- Orin two brushing methods
- . Net core stepping on the pit practice
- PHY驱动调试之 --- PHY控制器驱动(二)
- 三体目标管理笔记
- 2022年中纪实 -- 一个普通人的经历
- Logical structure and physical structure
- Configuration method and configuration file of SolidWorks GB profile library
- Marvell 88E1515 PHY loopback模式测试
- La redirection de l'applet Wechat ne déclenche pas onload
- 达梦数据库全部
猜你喜欢
随机推荐
A brief introduction to heading/pitch/roll and omega/phi/kappa
ethtool 原理介绍和解决网卡丢包排查思路(附ethtool源码下载)
Vscode creates its own code template
SRE核心体系了解
2022年中纪实 -- 一个普通人的经历
Huawei bracelet, how to add medicine reminder?
[algorithm post interview] interview questions of a small factory
Vant Weapp SwipeCell设置多个按钮
Volcano 资源预留特性
SD_CMD_RECEIVE_SHIFT_REGISTER
inux摄像头(mipi接口)简要说明
H5 模块悬浮拖动效果
微信小程序路由再次跳轉不觸發onload
6-2 sequence table operation set
how to understand the “model independent.“
Ret2xx---- common CTF template proposition in PWN
PHY驱动调试之 --- PHY控制器驱动(二)
Volcano resource reservation feature
Error: “MountVolume.SetUp failed for volume pvc 故障处理
The problem of Chinese garbled code in the vscode output box can be solved once for life




![[Gaode map POI stepping pit] amap Placesearch cannot be used](/img/4c/55586ffcc2267c477a4532ab51a0c1.png)




