ros then departure (B): Node node on the topic Topic

 roscore is command before running all ros command to run.

roscore = master + rosout(stdout + stderr) + parameter service 

 

Node node

A node is ros package executable file

 rosrun + package name + node name to execute a program.

We opened two nodes: one is above turtlesim_node, the other is the keyboard turtle_teleop_key they are in the package turtlesim.

Rqt_graph and visualized with their relationship.

 

Topics topic

Contact between the nodes with the topic, a node publish topic Another subscribe

We look at the usage rostopic

 

Let's use some rostopic order to familiarize yourself

Use rostopic echo the specific content of the message printed. At the same time update rqt_graph 

 

 

Next we look at the specific usage rostopic list of current topic and print them all

Or to the topic / turtle1 / cmd_vel between the keyboard and the turtle, for example, in the format

topic name  【topic type】

Can be understood as a node is executable train station, topic is train (carrier), it's the type of message that is actually delivered is the train is pulled or someone else or goods.

Then we look at this train (/ turtle1 / cmd_vel) in the end what is

 

Next, we made a number of parameters to the instruction manual Turtle (instead of the keyboard)

-1 for parameters sent once to exit, topic name + topic type + - (represents the next argument is not an order)

The meaning of the sentence is to let the turtle liner angular 2.0 and 1.8, the result is the turtle will draw an arc.

 

We then send a command stream to the turtle, it has been movement

-r indicates a command flow, a represents 1hz 

In this way, turtle will love going round in circles in a magic place. . .

 

Topic topic drawing rqt_plot

Dynamically view changes in the data.

rosrun rqt_plot rqt_plot  

 

发布了128 篇原创文章 · 获赞 21 · 访问量 3万+

Guess you like

Origin blog.csdn.net/Bluenapa/article/details/102955264