Main Content

このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。

パブリッシャーとサブスクライバー

メッセージ、トピックおよびネットワーク情報を作成し、送受信する

ROS では、"メッセージ"を使用して情報を共有します。メッセージは、データを共有するための単純なデータ構造体です。メッセージを受信 (すなわちサブスクライブ) するには、rossubscriberを使用します。メッセージを送信 (すなわちパブリッシュ) するには、rospublisherを使用します。メッセージ送信の詳細については、ROS のパブリッシャーおよびサブスクライバーとのデータ交換を参照してください。

関数

すべて展開する

rosmessage ROS メッセージの作成
rosmsg Retrieve information about ROS messages and message types
rosShowDetails Display all ROS message contents
rostopic Retrieve information about ROS topics
rospublisher メッセージをトピック上にパブリッシュ
rossubscriber トピック上のメッセージをサブスクライブ
receive 新しい ROS メッセージを待機
send ROS メッセージをトピックにパブリッシュ
rosrate Execute loop at fixed frequency
ros2message Create ROS 2 message structures
ros2 Retrieve information about ROS 2 network
rosShowDetails Display all ROS message contents
ros2publisher Publish messages on a topic
send トピックへの ROS 2 メッセージのパブリッシュ
ros2subscriber Subscribe to messages on a topic
receive Wait for new message
ros2message Create ROS 2 message structures

ブロック

すべて展開する

Blank Message 指定されたメッセージ タイプを使用した空白メッセージの作成
Blank Message 指定されたメッセージ タイプを使用した空白の ROS 2 メッセージの作成
Current Time 現在の ROS 時間またはシステム時間の取得
Publish Send messages to ROS network
Subscribe 从ROS netw接收消息ork
Blank Message 指定されたメッセージ タイプを使用した空白の ROS 2 メッセージの作成
Publish Send messages to ROS 2 network
Subscribe Receive messages from ROS 2 network

トピック

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 2

  • Work with Basic ROS 2 Messages
    ROSmessagesare the primary container for exchanging data in ROS 2. Publishers and subscribers exchange data using messages on specifiedtopicsto carry data between nodes. For more information on sending and receiving messages, see ROS 2 のパブリッシャーとサブスクライバーとのデータ交換.
  • ROS 2のパブリッシャーとサブスクライバーとのデータ交換
    ROS 2ノードがデータを交換するための主なメカニズムは、"メッセージ"を送受信することです。
  • Manage Quality of Service Policies in ROS 2
    Quality of Service (QoS) policy options allow for changing the behavior of communication within a ROS 2 network. QoS policies are modified for specific communication objects, such as publishers and subscribers, and change the way that messages are handled in the object and transported between them. For any messages to pass between two communication objects, their QoS policies must be compatible.
  • Manage Quality of Service Policies in ROS 2 Application with TurtleBot
    This example demonstrates best practices in managing Quality of Service (QoS) policies for an application using ROS 2. QoS policies allow for the flexible tuning of communication behavior between publishers and subscribers, and change the way that messages are transported within a ROS 2 network. For more information, see Manage Quality of Service Policies in ROS 2.
  • Using ROS Bridge to Establish Communication Between ROS and ROS 2
    ROS 2 is newer version of ROS with different architecture. Both the networks are separate and there is no direct communication between the nodes in ROS and ROS 2. Theros1_bridgepackage provides a network bridge which enables the exchange of messages between ROS and ROS 2. The bridge manages all the conversion required and sends messages across both the networks. For more information, seeros1_bridge. This example uses a virtual machine which may be downloaded by following the instructions in Gazebo およびシミュレートされた TurtleBot の入門. Theros1_bridgepackage is installed on this virtual machine.