当前位置:网站首页>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
边栏推荐
猜你喜欢
Volcano 资源预留特性
Special training of C language array
逻辑结构与物理结构
Rehabilitation type force deduction brush question notes D2
Vant Weapp SwipeCell設置多個按鈕
All English in the code
ROS2——常用命令行(四)
The problem of Chinese garbled code in the vscode output box can be solved once for life
【MySQL8.0不支持表名大写-对应方案】
confidential! Netease employee data analysis internal training course, white whoring! (attach a data package worth 399 yuan)
随机推荐
inux摄像头(mipi接口)简要说明
2022 winter vacation training game 5
微信小程序路由再次跳轉不觸發onload
7. Oracle table structure
[QT] QT multithreading development qthread
Unity 之 ExecuteAlways正在取代ExecuteInEditMode
[Gaode map POI stepping pit] amap Placesearch cannot be used
Adg5412fbruz-rl7 applies dual power analog switch and multiplexer IC
Design specification for mobile folding screen
H5 embedded app adapts to dark mode
TypeScript入门
Huawei bracelet, how to add medicine reminder?
Preemption of CFS scheduling
H5 模块悬浮拖动效果
Relevant information of National Natural Science Foundation of China
Markdown syntax
Initialization of global and static variables
Use the Paping tool to detect TCP port connectivity
在本地搭建一个微服务集群环境,学习自动化部署
全局变量和静态变量的初始化