当前位置:网站首页>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
边栏推荐
- Lexin interview process
- [tf] Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initial
- Application of recyclerview
- SD_CMD_SEND_SHIFT_REGISTER
- Ros2 - workspace (V)
- Pycahrm reports an error: indentation error: unindent does not match any outer indentation
- ROS2——安装ROS2(三)
- UIO driven framework
- H5 embedded app adapts to dark mode
- Marvell 88e1515 PHY loopback mode test
猜你喜欢
Orin installs CUDA environment
Financial risk control practice -- feature derivation based on time series
2. Addition and management of Oracle data files
Vant Weapp SwipeCell设置多个按钮
Mutual transformation between two-dimensional array and sparse array (sparse matrix)
ROS2——node节点(七)
inux摄像头(mipi接口)简要说明
The “mode“ argument must be integer. Received an instance of Object
Marvell 88E1515 PHY loopback模式测试
Configuration method and configuration file of SolidWorks GB profile library
随机推荐
ROS2——配置开发环境(五)
Vant Weapp SwipeCell設置多個按鈕
About vscode, "code unreachable" will be displayed when calling sendline series functions with pwntools“
Time is fast, please do more meaningful things
‘mongoexport‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件。
Build a microservice cluster environment locally and learn to deploy automatically
The difference between new and malloc
La redirection de l'applet Wechat ne déclenche pas onload
GDB code debugging
Volcano 资源预留特性
全局变量和静态变量的初始化
H5 module suspension drag effect
Architecture
A brief introduction to heading/pitch/roll and omega/phi/kappa
Page type
cgroup_ memcg
Orin 两种刷机方式
What is linting
ROS2——node节点(七)
Edge calculation data sorting