当前位置:网站首页>ROS learning_ Basics
ROS learning_ Basics
2022-07-06 06:51:00 【Leslie x Xu】
ROS Command line tools use
One 、 Common commands
- roscore : start-up ros
- rosrun :
rosrun [package_name] [node_name]Call node The parameters are function package name and node name - rosnode :
rosnode listList the currently running nodes - rqt_graph : Visualize the currently running nodes
- rostopic : Operate the topic
rostopic pub: Post topic newsrostopic type: View message types
- rosservice : Operate the service
rosservice call: Publish service request
- rosparam
- rosmsg : Get the details of the message
- rossrv
Two 、 Example : Turtle simulation
start-up ROS Master:
$roscoreStart the turtle Simulator :
$rosrun turtlesim turtlesim_nodeStart the turtle control node :
$rosrun turtlesim turtle_teleop_key
Be careful : These three commands are executed on three terminals respectively .function

3、 ... and 、 Post topic news
Release the news Keep the turtle moving .
- First check the message type
~$ rostopic type /turtle1/cmd_vel
geometry_msgs/Twist
~$ rosmsg show geometry_msgs/Twist
geometry_msgs/Vector3 linear
float64 x
float64 y
float64 z
geometry_msgs/Vector3 angular
float64 x
float64 y
float64 z
- Write parameters
~$ rostopic pub -r 10 /turtle1/cmd_vel geometry_msgs/Twist " linear: x: 1.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.0 "
Be careful : Parameter alignment
- function

Four 、 Publish service request
Publish service request , Add a new turtle .
- View request information
~$ rosservice info /spawn
Node: /turtlesim
URI: rosrpc://ros2go:39063
Type: turtlesim/Spawn
Args: x y theta name
- Release request
~$ rosservice call /spawn " x: 5.0 y: 5.0 theta: 0.0 name: 'turtle2' "
name: "turtle2"
- function

5、 ... and 、 The difference between topic and service
- topic of conversation (Topic)
- Asynchronous communication mechanism between nodes
- Use Release / subscribe Model
- Topic data : news (Message) File format
.msg
- service (Service)
- Synchronous communication mechanism between nodes
- Use client / The server (C/S) Model
- data : File format
.srv
边栏推荐
- Huawei equipment configuration ospf-bgp linkage
- Day 248/300 thoughts on how graduates find jobs
- Thesis abstract translation, multilingual pure human translation
- At the age of 26, I changed my career from finance to software testing. After four years of precipitation, I have been a 25K Test Development Engineer
- Distributed system basic (V) protocol (I)
- LeetCode每日一题(971. Flip Binary Tree To Match Preorder Traversal)
- My creation anniversary
- Is it difficult for girls to learn software testing? The threshold for entry is low, and learning is relatively simple
- SQL Server Manager studio (SSMS) installation tutorial
- 删除外部表源数据
猜你喜欢

Chinese English comparison: you can do this Best of luck

The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower

Apache dolphin scheduler source code analysis (super detailed)

Suspended else

Entity Developer数据库应用程序的开发

mysql的基础命令

机器学习植物叶片识别

How to convert flv file to MP4 file? A simple solution

How effective is the Chinese-English translation of international economic and trade contracts

Biomedical localization translation services
随机推荐
Simple query cost estimation
CS certificate fingerprint modification
删除外部表源数据
【Hot100】739. 每日溫度
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/home/yolov5/models/comm
Distributed system basic (V) protocol (I)
Phishing & filename inversion & Office remote template
SSO流程分析
ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用Shap值对XGBoost模型实现可解释性案例之详细攻略
Pallet management in SAP SD delivery process
My creation anniversary
ROS2安装及基础知识介绍
pymongo获取一列数据
[Yu Yue education] Dunhuang Literature and art reference materials of Zhejiang Normal University
UDP攻击是什么意思?UDP攻击防范措施
Every API has its foundation when a building rises from the ground
Leetcode daily question (1870. minimum speed to arrive on time)
C语言_双创建、前插,尾插,遍历,删除
Changes in the number of words in English papers translated into Chinese
ROS学习_基础