Keypoints:
Nodes: A node is a process that performs computation. Nodes are combined together into a graph and communicate with one another using streaming topics, RPC services, and the Parameter Server. Nodes are typically written in C++ or Python, but other language implementations are supported. Different ROS implementations can communicate with each other which is in different language or different computer through a common ROS Master.
ROS Master: The ROS Master provides naming and registration services to the rest of the nodes in the ROS system. Without the Master, nodes would not be able to find each other, exchange messages, or invoke services. The ROS Master also facilitates parameter server, which allows nodes to store parameters at a global location and share them among each other.
Topics: Nodes can publish or subscribe to a topic. A topic is a bus over which nodes exchange messages unsynchronously. Topics have anonymous publish/subscribe semantics, which decouples the production of information from its consumption. In general, nodes are not aware of who they are communicating with. Instead, nodes that are interested in data subscribe to the relevant topic; nodes that generate data publish to the relevant topic. There can be multiple publishers and subscribers to a topic.
Messages: Nodes communicate with each other by passing messages. A message is a simple data structure, comprising typed fields. Standard primitive types (integer, floating point, boolean, etc.) are supported, as are arrays of primitive types. Messages can include arbitrarily nested structures and arrays (much like C structs).
Services: While topics enable nodes to send data to each other, services allow nodes to call functions on each other. A service is defined by a pair of message structures: one for the request and one for the response. A providing node offers a service under a string name, and a client calls the service by sending the request message and awaiting the reply. Services are synchronous: the service call only returns once the service has completed. Servers can manage multiple requests simultaneously. Clients can also make persistent connections to services, allowing for streaming communication.
Parameters: The Parameter Server is a shared, multi-variate dictionary that is accessible via network APIs. It is intended to store settings such as configuration parameters. More about static parameters.
roscore : to launch ros master.
rosnode list: to list all ros nodes.
rosnode info: to get information about a specific node.
rostopic list: to list all ros topics.
rostopic pub topic_name message_name data
rostopic pub /turtle1/cmd_vel geometry_msgs/Twist "linear: rostopic pub -r 10 /turtle1/cmd_vel geometry_msgs/Twist "linear:
rosbag record -a -O bag_file_name
rosbag record -O subset /turtle1/cmd_vel /turtle1/pose
: to record specific messages (i.e /turtle1/cmd_vel /turtle1/pose) and store it as subset.bag. rosbag play bag_file_name
rosplay subset.bag