Main Content

MATLAB 内の ROS 2

MATLAB® を使用して ROS 2 のネットワークおよびメッセージにアクセスする

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

ROS 2 のサービスとアクションにより、ユーザーはタスクを実行できます。サービスでは、要求と応答の通信を使用して情報を収集し、ROS 2 ネットワークでコールバック関数をトリガーします。アクションを使用すると、タスクやゴールをトリガーし、これらのタスクの操作中にフィードバックを受信できます。

関数

すべて展開する

ros2messageROS 2 メッセージ構造体の作成
ros2Retrieve information about ROS 2 network
rosShowDetailsすべての ROS メッセージの内容の表示
ros2publisherPublish messages on a topic
sendトピックへの ROS 2 メッセージのパブリッシュ
ros2subscriberSubscribe to messages on a topic
receiveWait for new message
ros2messageROS 2 メッセージ構造体の作成
callCall ROS or ROS 2 service server and receive a response
isServerAvailableDetermine if ROS or ROS 2 service server is available
ros2Retrieve information about ROS 2 network
ros2svcclientConnect to ROS 2 service server
ros2svcserverCreate ROS 2 service server
waitForServerWait for ROS or ROS 2 service server to start

ROS 2 アクション クライアント

ros2actionclientCreate ROS 2 action client
waitForServerWait for ROS 2 action server to be ready for sending goals
sendGoalSend goal message to ROS 2 action server
getStatusGet execution status of specific goal sent by ROS 2 action client
ros2ActionSendGoalOptionsReturn structure for ROS 2 action client callback
cancelGoalCancel specific goal sent by ROS 2 action client
cancelGoalAndWaitCancel specific goal sent by ROS 2 action client and wait for cancel response
cancelGoalsBeforeCancel goals sent by ROS 2 action client before timestamp
cancelGoalsBeforeAndWaitCancel goals sent by ROS 2 action client before timestamp and wait for cancel response
cancelAllGoalsCancel all active goals sent by ROS 2 action client
cancelAllGoalsAndWaitCancel all active goals sent by ROS 2 action client and wait for cancel response

ROS 2 アクション ゴール ハンドル

ActionClientGoalHandleGoal handle object for ROS 2 action client goals
getResultGet result of specific goal associated with goal handle

ブロック

すべて展開する

Blank Message指定されたメッセージ タイプを使用した空白の ROS 2 メッセージの作成
PublishSend messages to ROS 2 network
SubscribeReceive messages from ROS 2 network
Call ServiceCall service in ROS 2 network

トピック

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

ROS 2 サービス

  • Call and Provide ROS 2 Services
    Set up service servers to advertise a service to the ROS network. In addition, you will learn how to use service clients to call the server and receive a response.