このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
サービスとアクション
ROS のサービスとアクションにより、ユーザーはタスクを実行できます。サービスでは、要求と応答の通信を使用して情報を収集し、ROS ネットワークでコールバック関数をトリガーします。アクションを使用すると、タスクやゴールをトリガーし、これらのタスクの操作中にフィードバックを受信できます。
関数
ブロック
Call Service | Call service in ROS network |
Call Service | Call service in ROS 2 network |
トピック
- Call and Provide ROS Services
ROS supports two main communication mechanisms: topics and services. Topics have publishers and subscribers and are used for sending and receiving messages (see ROS のパブリッシャーおよびサブスクライバーとのデータ交換). Services, on the other hand, implement a tighter coupling by allowing request-response communication. A service client sends a request message to a service server and waits for a response. The server will use the data in the request to construct a response message and sends it back to the client. Each service has a type that determines the structure of the request and response messages. Services also have a name that is unique in the ROS network.
- Call and Provide ROS 2 Services
ROS supports two main communication mechanisms: topics and services. Topics have publishers and subscribers and are used for sending and receiving messages (see ROS 2 のパブリッシャーとサブスクライバーとのデータ交換). Services, on the other hand, implement a tighter coupling by allowing request-response communication. A service client sends a request message to a service server and waits for a response. The server will use the data in the request to construct a response message and sends it back to the client. Each service has a type that determines the structure of the request and response messages.
- ROS Actions Overview
ROS action workflow and communication protocols
- Move a Turtlebot Robot Using ROS Actions
This example shows how to use the
/turtlebot_move
action with a Turtlebot robot. The/turtlebot_move
action takes a location in the robot environment and attempts to move the robot to that location.