当前位置:网站首页>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 list
List 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:
$roscore
Start the turtle Simulator :
$rosrun turtlesim turtlesim_node
Start 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
边栏推荐
- 19.段页结合的实际内存管理
- UniPro甘特图“初体验”:关注细节背后的多场景探索
- ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用Shap值对XGBoost模型实现可解释性案例之详细攻略
- Every API has its foundation when a building rises from the ground
- How to convert flv file to MP4 file? A simple solution
- 【软件测试进阶第1步】自动化测试基础知识
- [advanced software testing step 1] basic knowledge of automated testing
- Distributed system basic (V) protocol (I)
- It is necessary to understand these characteristics in translating subtitles of film and television dramas
- Automated test environment configuration
猜你喜欢
接口自动化测试框架:Pytest+Allure+Excel
After sharing the clone remote project, NPM install reports an error - CB () never called! This is an error with npm itself.
BUU的MISC(不定时更新)
前缀和数组系列
What is the difference between int (1) and int (10)? Senior developers can't tell!
Thesis abstract translation, multilingual pure human translation
My creation anniversary
机器学习植物叶片识别
Facebook AI & Oxford proposed a video transformer with "track attention" to perform SOTA in video action recognition tasks
CS-证书指纹修改
随机推荐
UniPro甘特图“初体验”:关注细节背后的多场景探索
Data security -- 13 -- data security lifecycle management
UNIPRO Gantt chart "first experience": multi scene exploration behind attention to details
Redis Foundation
Day 239/300 注册密码长度为8~14个字母数字以及标点符号至少包含2种校验
What is the difference between int (1) and int (10)? Senior developers can't tell!
Practical guidance for interface automation testing (Part I): what preparations should be made for interface automation
Reflex WMS中阶系列3:显示已发货可换组
Call, apply, bind rewrite, easy to understand with comments
After sharing the clone remote project, NPM install reports an error - CB () never called! This is an error with npm itself.
[advanced software testing step 1] basic knowledge of automated testing
Wish Dragon Boat Festival is happy
指尖上的 NFT|在 G2 上评价 Ambire,有机会获得限量版收藏品
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/home/yolov5/models/comm
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
Delete external table source data
ECS accessKey key disclosure and utilization
How to translate professional papers and write English abstracts better
Leetcode daily question (1870. minimum speed to arrive on time)
Chapter 7 - thread pool of shared model