MATLAB 内の ROS
MATLAB® を使用して ROS のネットワークおよびメッセージにアクセスする
ROS では、"メッセージ" を使用して情報を共有します。メッセージは、データを共有するための単純なデータ構造体です。メッセージを受信 (すなわちサブスクライブ) するには、rossubscriber
を使用します。メッセージを送信 (すなわちパブリッシュ) するには、rospublisher
を使用します。メッセージ送信の詳細については、ROS のパブリッシャーおよびサブスクライバーとのデータ交換を参照してください。
ROS のサービスとアクションにより、ユーザーはタスクを実行できます。サービスでは、要求と応答の通信を使用して情報を収集し、ROS ネットワークでコールバック関数をトリガーします。アクションを使用すると、タスクやゴールをトリガーし、これらのタスクの操作中にフィードバックを受信できます。
関数
ブロック
トピック
ROS のパブリッシャーとサブスクライバー
- Work with Basic ROS Messages
Messages are the primary container for exchanging data in ROS. Topics and services use messages to carry data between nodes. (See ROS のパブリッシャーおよびサブスクライバーとのデータ交換 and Call and Provide ROS Services for more information on topics and services) - Built-In Message Support
List of supported ROS message types in MATLAB. - ROS のパブリッシャーおよびサブスクライバーとのデータ交換
ROS ノードがデータを交換するための主なメカニズムは、"メッセージ" を送受信することです。 - Work with Specialized ROS Messages
Some commonly used ROS messages store data in a format that requires some transformation before it can be used for further processing. MATLAB® can help you by formatting these specialized ROS messages for easy use. In this example, you explore how to handle message types for laser scans, uncompressed and compressed images, point clouds, camera info, occcupancy grid, and octomap messages. - Publish Variable-Length Nested ROS Messages in MATLAB
This example shows how to work with complex ROS messages in MATLAB, such as messages with nested submessages and variable-length arrays. - Improve Performance of ROS Using Message Structures
This example demonstrates the use of ROS message structures, and their benefits and differences from message objects.
ROS のサービスとアクション
- 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. - 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.