当前位置:网站首页>ROS topics and nodes

ROS topics and nodes

2022-06-13 03:51:00 X uuuer.

ROS Simple understanding

Node: node , A node is an executable file , It can go through ROS Communicate with other nodes .

Topics: topic of conversation , Nodes can publish messages to topics , You can also subscribe to topics to receive messages .

Master : Node manager ,ROS The name of the service ( For example, help nodes find each other ).

  1. ROS Topics (ROS topic of conversation )

Two node It is through Topic communication .1 node (node), Release functions to a Topic, If 2 node (node) Subscribed to this Topic, It can get the content of the function .

Can pass rqt_graph See what's running node and topic:rosrun rqt_graph rqt_graph

  1. introduce rostopic: It can be downloaded from ROS topic pick up information

Such as :rostopic echo: Show publish to topic The data on the , usage :rostopic echo [topic]

rostopic list: This command will list all the currently being published and subscribed topic.

rostopic info: Print information about the campaign topic, including the publisher 、 subscriber 、 And Message type .

  1. ROS Messages

node It's through topic Send... Above message Come to communicate .

Publishers and subscribers can communicate , Because they use the same Message type ,topic The type of depends on message The type of .message The type of can be determined by rostopic type To define .

rostopic type: It can return any topic Published message type .

usage :rostopic type [topic]

View the message The specific member variables in the type :

rosmsg show [type]

msg File is ROS File that defines the message type in

  1. Publisher Its main function is to publish messages of specific data types for specific topics .
  2. Create a Subscriber To subscribe to Publisher The message published by the node .

Inside the ellipse are nodes , The arrow represents the message flow

原网站

版权声明
本文为[X uuuer.]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/164/202206130342533335.html