当前位置:网站首页>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
边栏推荐
- Phishing & filename inversion & Office remote template
- How effective is the Chinese-English translation of international economic and trade contracts
- 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
- Pymongo gets a list of data
- 18.多级页表与快表
- Distributed system basic (V) protocol (I)
- 红蓝对抗之流量加密(Openssl加密传输、MSF流量加密、CS修改profile进行流量加密)
- What is the difference between int (1) and int (10)? Senior developers can't tell!
- How to convert flv file to MP4 file? A simple solution
- Call, apply, bind rewrite, easy to understand with comments
猜你喜欢

我的创作纪念日

What is the difference between int (1) and int (10)? Senior developers can't tell!

In English translation of papers, how to do a good translation?

详解SQL中Groupings Sets 语句的功能和底层实现逻辑

AI on the cloud makes earth science research easier

Cobalt strike feature modification

Reflex WMS中阶系列3:显示已发货可换组

My creation anniversary

What are the characteristics of trademark translation and how to translate it?

How much is the price for the seal of the certificate
随机推荐
[English] Grammar remodeling: the core framework of English Learning -- English rabbit learning notes (1)
查询字段个数
[English] Verb Classification of grammatical reconstruction -- English rabbit learning notes (2)
After sharing the clone remote project, NPM install reports an error - CB () never called! This is an error with npm itself.
Machine learning plant leaf recognition
On the first day of clock in, click to open a surprise, and the switch statement is explained in detail
中青看点阅读新闻
kubernetes集群搭建Zabbix监控平台
一文读懂简单查询代价估算
机器人类专业不同层次院校课程差异性简述-ROS1/ROS2-
Do you really know the use of idea?
医疗软件检测机构怎么找,一航软件测评是专家
Brief introduction to the curriculum differences of colleges and universities at different levels of machine human major -ros1/ros2-
UNIPRO Gantt chart "first experience": multi scene exploration behind attention to details
Data security -- 13 -- data security lifecycle management
雲上有AI,讓地球科學研究更省力
LeetCode每日一题(1997. First Day Where You Have Been in All the Rooms)
Reflex WMS medium level series 3: display shipped replaceable groups
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
因高额网络费用,Arbitrum 奥德赛活动暂停,Nitro 发行迫在眉睫