当前位置:网站首页>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
边栏推荐
- Vant Weapp SwipeCell设置多个按钮
- 6-3 find the table length of the linked table
- mingling
- The differences and connections among cookies, sessions, JWT, and tokens
- Technical conference arrangement
- Integer to 8-bit binary explanation (including positive and negative numbers) scope of application -127~+127
- Sre core system understanding
- ROS2——常用命令行(四)
- 微信小程序路由再次跳转不触发onload
- Markdown syntax
猜你喜欢
SolidWorks template and design library are convenient for designers to call
Idea debug failed
PHY驱动调试之 --- MDIO/MDC接口22号和45号条款(一)
Rehabilitation type force deduction brush question notes D2
LSA Type Explanation - lsa-1 [type 1 LSA - router LSA] detailed explanation
Orin installs CUDA environment
1. Create Oracle database manually
MPLS experiment
Financial risk control practice -- feature derivation based on time series
Skywalking全部
随机推荐
Genesis builds a new generation of credit system
基于FPGA的一维卷积神经网络CNN的实现(八)激活层实现
Mutual transformation between two-dimensional array and sparse array (sparse matrix)
摄像头的MIPI接口、DVP接口和CSI接口
mysql设置触发器问题
ROS2——初识ROS2(一)
mingling
Vscode creates its own code template
SOC_SD_DATA_FSM
PR automatically moves forward after deleting clips
vim
Dameng database all
Stack acwing 3302 Expression evaluation
[tf] Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initial
The “mode“ argument must be integer. Received an instance of Object
[MySQL 8.0 does not support capitalization of table names - corresponding scheme]
6-3 find the table length of the linked table
ROS2——node节点(七)
Instruction execution time
ROS2——配置开发环境(五)