Commonly used shell commands under ros system

roscd turtlesim/ jumps to the directory corresponding to the function package.

The main function of roscore is to enable the master node of ros

rosrun [package name] [executable node] 

 eg:rosrun turtlesim turtlesim_node, turtlesim is a small demo provided by the official

rosnode node-related commands,

 ros list, ros info /turtlesim (command for node information query) rosnode kill /turtlesim kills a process

rosnode machine checks which node is running on that machine. The node can run on multiple devices.

rosnode machine ubuntu can see the node that the host Ubuntu is running.

rostopic press Enter, you can see what parameters rostopic can follow

 rostopic list lists all currently active topics

rostopic info /turtle1/cmd_vel View related topic information, type, publish and subscribe relationships

rostopic echo /turtle1/cmd_vel prints relevant information, such as information about the movement of the little turtle

rostopic type /turtle1/cmd_vel Check the type of topic

rostopic pub -r 10 /turtle1/cmd_vel geometry_msgs./Twist "linea: issue commands through pub

-r 10 issues commands at 10hz.

rosservice and service-related commands

 Use the rosmsg command to view the message type of each topic. The usage of rossrv is similar to that of rosmsg. They both view service-related information.

Rosbag can record information about the current topic. It is mainly used to record some experimental processes, such as robot navigation tests, record the data, and replay it.

 rosbag record /turtle1/cmd_vel -o subset //-o specifies the topic name - the a parameter is to record all topics

rosbag play subset.bag plays the recorded data set.

Guess you like

Origin blog.csdn.net/qq_44808827/article/details/123305934