Applications of topics, services, and actionlib
Topics, services, and actionlib
are used in different scenarios. We know topics are a unidirectional communication method, services are a bidirectional request/reply kind of communication, and that actionlib
is a modified form of ROS service in which we can cancel the process that's running on the server as required.
Here are some of the areas where we use these methods:
- Topics: Streaming continuous data flows, such as sensor data; for example, we can stream joypad data to teleoperate a robot, publish robot odometry, and publish a video stream from a camera.
- Services: Executing procedures that terminate quickly; for example, to save the calibration parameters of sensors, to save a map that's been generated by the robot during its navigation, or to load a parameter file.
- actionlib: Executing long and complex actions while managing their feedback; for example, to navigate toward a target or plan a motion path...