Welcome to JetCobot repository
3.ROS common command tools
3.ROS common command tools
We introduced the four important concepts of nodes, messages, topics, and services in [1. Introduction to ROS] - [1.2.1. Computational graph level]. During the running process of ROS, it is often necessary to use some commands to debug the program. This section introduces the common debugging commands of ros.
3.1 Node rosnode
When developing and debugging, you often need to view the current node and node information, so please remember these common commands. If you can't remember it, you can also check the rosnode command usage through rosnode help.

Terminal input,
rosnode
3.2 Message rosmsg
msg is equivalent to a data type. You can check which msg is available in the current ros environment. Some common usages are as follows:

Terminal input,
xxxxxxxxxxrosmsg

3.3 Topic rostopic
Topics are one of the commonly used communication methods between nodes in ros. Rostopic provides tools for printing topic messages (equivalent to subscribers), tools for publishing messages (equivalent to publishers), and other tools.It is convenient for us to debug and check whether the subscriber or publisher of the node subscribes and publishes the message normally. The common usage is as follows:

Terminal input,
xxxxxxxxxxrostopic
/topic represents the name of the topic. For example, if you need to output the /hello message of the topic name, enter it in the terminal.
xxxxxxxxxxrostopic echo /hello3.4 Service rosservice
Service is also one of the commonly used communication methods between nodes in ros. It is different from the topic in that it has a response value, that is, node A requests node B to provide services. After B provides services, There needs to be a response value (response), which can be understood as a return value. Commonly used usages are as follows:

Terminal input,
xxxxxxxxxxrosservice

Similarly, /service here is also replaced based on the actual service name. For example, when displaying the service information of /add_two_ints of the service name, enter it in the terminal,
xxxxxxxxxxrosservice info /add_two_ints