ROS tools in Linux
1. open Turtlesim
1 | roscore # start the ROS Master |
1 | rosrun turtlesim turtlesim_node # start the turtlesim |
1 | rosrun turtlesim turtle_teleop_key # start turtle control node |

2. rqt_graph
1 | rqt_graph |

/turtlesimnode is a simple simulator for teaching ROS concepts.teleop_turtlenode/turtle1/cmd_veltopic
3. rosnode list
1 | rosnode list # show the current nodes |

3. rosnode info
1 | rosnode info somenode # check somenode's information |

4. rostopic list
1 | rostopic list # show the current topic |

5. rostopic pub
1 | rostopic pub /turtle1/cmd_vel # |
click tab button twice
1 | rostopic pub /turtle1/cmd_vel geometry_msgs/Twist "linear: |

- we can find turtle move
- but only move once
- it is because pub instruction only publish one time
1 | rostopic pub -r 10 /turtle1/cmd_vel geometry_msgs/Twist "linear: |
add -r 10 after pub,
-rmeans rate,10means 10 times per second

6. rosmsg show
1 | rosmsg show geometry_msgs/Twist |

7. rosservice list
1 | rosservice list # show all service |

8. rosservice call
1 | rosservice call /spawn |
click tab for 2 times
1 | rosservice call /spawn "x: 2.0 |

we create another turtle
now we call rostopic list again, we can find we have turtle2 here

9. rosbag record
1 | rosbag record -a -O cmd_record # record the data into cmd_record file |
- we can find a new file under current folder has been created
- named cmd_record.bag
1 | rosbag play cmd_record.bag # play the data(the cmd_record file) |