Simulink における ROS 2 ネットワーク アクセス
R2026bSimulink® を使用して ROS 2 のネットワークおよびメッセージにアクセスする
ROS Toolbox を使用して、ROS および ROS 2 に Simulink 内で接続し、ネットワーク経由でメッセージを送信できます。Get Started with ROS 2 in Simulinkを参照してください。
また、コードを生成してターゲット システムに展開することもできます。スタンドアロンの ROS 2 ノードの作成に関する高度な例については、Generate Standalone ROS 2 Node from Simulinkを参照してください。
ROS 2 デバイス上で使用可能な展開済みの ROS 2 ノードの実行、停止、またはステータス チェックを行うには、リストにある MATLAB® 関数を使用します。ros2device を使用して ROS デバイスへの接続を作成します。
メモ
サブシステム参照内での ROS 2 ブロックの使用はサポートされていません。これは、ROS Toolbox はデータ ディクショナリを使用してモデル情報を保存しますが、サブシステム参照ではアタッチされたデータ ディクショナリの移植性がサポートされていないためです。サブシステム参照の使用の詳細については、ライブラリ ディクショナリを使用する場合の考慮事項 (Simulink)を参照してください。
ROS 2 ブロックは、ソフトウェアインザループ (SIL) およびプロセッサインザループ (PIL) のシミュレーションではサポートされていません。
関数
ブロック
トピック
ROS 2 ネットワーク
- Get Started with ROS 2 in Simulink
Use Simulink blocks for ROS 2 to send and receive messages from a local ROS 2 network. - Simulink での ROS 2 メッセージのパブリッシュとサブスクライブ
Simulink を使用して ROS 2 トピックをパブリッシュおよびサブスクライブします。 - Connect to ROS-Enabled Robot from Simulink over ROS 2
Configure a Simulink model to send and receive information from a separate ROS-based simulator such as Gazebo over ROS 2.
ROS 2 メッセージ
- Work with ROS 2 Messages in Simulink
Work with complex ROS 2 messages in Simulink, such as messages with nested sub-messages and variable-length arrays. - Simulink での ROS メッセージの配列サイズの管理
Simulink で ROS の配列サイズを管理するためのダイアログ ボックスの説明。 - Log ROS 2 Messages from Simulink to ROS 2 Bag File
Save ROS 2 message data from Simulink to a ros2bag file. - Use ROS 2 Logger App to Save ROS 2 Messages from Simulink
Use ROS 2 Logger app to record ROS 2 messages during Simulink simulation. - Configure CAN Interfaces and Apply Message Filtering
Use CAN properties to configure parameters at CAN node level and option to allow all messages.
ROS 2 アプリケーション
- Generate Standalone ROS 2 Node from Simulink
Generate and build a standalone ROS 2 node from a Simulink model. - Feedback Control of a ROS-Enabled Robot over ROS 2
Use Simulink to control a simulated robot running in a Gazebo robot simulator over ROS 2 network. - Sign-Following Robot with ROS 2 in Simulink
Use Simulink to control a simulated robot running on a separate ROS-based simulator over ROS 2 network. - Automated Parking Valet with ROS 2 in Simulink
Distribute an automated parking valet application among various nodes in a ROS 2 network in Simulink. - Send and Receive CAN Data in Simulink Using ROS 2-CAN Bridge Node
Design and test a feedback control algorithm in Simulink® using CAN messages exchanged between the CAN and ROS 2 network. - Plan Excavator Trajectory in ROS 2 Using Asynchronous Service Server
Use asynchronous ROS 2 service server in Simulink to plan and execute collision-free trajectories for a simulated autonomous excavator. - Control UR5 Robotic Arm Using ROS 2 Action Client in Simulink
Use ROS 2 action client in Simulink to command a UR5 robotic arm in Gazebo by sending a joint trajectory goal to its trajectory controller.
モデルの実行
- Monitor and Tune ROS 2 Models Using External Mode
Use external mode for real-time monitoring, tuning, and validation of ROS 2 models. - Enable ROS 2 Time Model Stepping for Deployed Nodes
You can enable a deployed ROS 2 node to execute based on the time published on the/clocktopic on a ROS 2 network. - Create Execution-Time Profile for Deployed ROS 2 Nodes Using XCP-Based External Mode
Measure and analyze execution time performance of deployed ROS 2 node code using XCP-based external mode profiling.









