Simulink에서의 ROS 네트워크 액세스
Simulink®를 사용하여 ROS 네트워크와 메시지에 액세스
ROS Toolbox를 사용하면 Simulink에서 ROS 및 ROS 2에 연결할 수 있으며 네트워크를 통해 메시지를 보낼 수 있습니다. Get Started with ROS in Simulink 항목을 참조하십시오.
타깃 시스템에 코드를 생성하고 배포할 수도 있습니다. 독립형 ROS 노드 생성에 대한 고급 예제는 Generate a Standalone ROS Node from Simulink 항목을 참조하십시오.
ROS 장치에 배포되어 사용할 수 있는 ROS 노드를 실행하거나 중지하거나 노드의 상태를 확인하려면 아래에 나열된 MATLAB® 함수를 사용합니다. rosdevice
를 사용하여 ROS 장치에 대한 연결을 만듭니다.
참고
ROS 블록은 서브시스템 참조 내에서 사용할 수 없습니다. ROS Toolbox는 데이터 사전을 사용하여 모델 정보를 저장하는데, 서브시스템 참조에서는 모델에 연결된 데이터 사전의 이식을 지원하지 않기 때문입니다. 서브시스템 참조 사용에 대한 자세한 내용은 Considerations When Using a Library Dictionary (Simulink) 항목을 참조하십시오.
ROS 2 블록은 SIL(Software-in-the-Loop) 시뮬레이션과 PIL(Processor-in-the-Loop) 시뮬레이션에서 지원되지 않습니다.
함수
블록
ROS Apply Transform, ROS 2 Apply Transform | Transform input ROS or ROS 2 message to target frame (R2023b 이후) |
Blank Message | 지정된 메시지 유형을 사용해 빈 메시지 생성 (R2019b 이후) |
Call Service | Call service in ROS network (R2019b 이후) |
Current Time | 현재 ROS 시간 또는 시스템 시간 가져오기 (R2019b 이후) |
Get Parameter | Get values from ROS parameter server (R2019b 이후) |
Get Transform | Get transformation between source and target frame from ROS network (R2023b 이후) |
Header Assignment | Update fields of ROS message header (R2021a 이후) |
Publish | Send messages to ROS network (R2019b 이후) |
Read Data | Play back data from log file (R2019b 이후) |
Read Image | Extract image from ROS Image message (R2019b 이후) |
ROS Read Scan, ROS 2 Read Scan | Extract scan data from ROS or ROS 2 laser scan message (R2022a 이후) |
Read Point Cloud | Extract point cloud from ROS PointCloud2 message (R2019b 이후) |
Set Parameter | Set values on ROS parameter server (R2019b 이후) |
Subscribe | Receive messages from ROS network (R2019b 이후) |
ROS Write Image, ROS 2 Write Image | Write image data to a ROS or ROS 2 message (R2022a 이후) |
ROS Write Point Cloud, ROS 2 Write Point Cloud | Write point cloud data to a ROS or ROS 2 message (R2022a 이후) |
도움말 항목
ROS 네트워크
- ROS Simulink Support and Limitations
The ROS Toolbox does not support the following ROS features in Simulink: - Get Started with ROS in Simulink
Use Simulink blocks for ROS to send and receive messages from a local ROS network. - Configure ROS Network Addresses
Configure ROS Network Addresses Dialog - Connect to a ROS-enabled Robot from Simulink
Configure Simulink to connect to a separate robot simulator using ROS and then send velocity commands, and receive position information from a simulated robot. - ROS Parameters in Simulink
Details for setting ROS parameters in Simulink. - Connect to ROS Device
Parameters for connecting to a ROS device. - ROS Simulink Interaction
Simulink and ROS Interaction Overview
ROS 메시지
- Work with ROS Messages in Simulink
Work with complex ROS messages in Simulink, such as messages with nested sub-messages and variable-length arrays. - Select ROS Topics, Messages, and Parameters
Dialog box descriptions for selection ROS topics and messages. - Log ROS Messages from Simulink to a Rosbag Logfile
Save ROS message data from Simulink to a rosbag file. - Use ROS Logger App to Save ROS Messages from Simulink
Use ROS Logger app to record ROS messages during Simulink simulation. - Manage Array Sizes for ROS Messages in Simulink
Description of dialog box for managing array sizes in Simulink ROS
ROS 애플리케이션
- Generate a Standalone ROS Node from Simulink
Generate and build a standalone ROS node from a Simulink model. - Feedback Control of a ROS-Enabled Robot
Use Simulink to control a simulated robot running in a separate ROS-based simulator. - Sign-Following Robot with ROS in Simulink
Use Simulink to control a simulated robot running on a separate ROS-based simulator. - Automated Parking Valet with ROS in Simulink
Distribute an automated parking valet application among various nodes in a ROS network in Simulink. - Generate Code to Manually Deploy a ROS Node from Simulink
This example shows you how to generate C++ code from a Simulink model to deploy as a standalone ROS node. - Emergency Braking of Ego Vehicle in CARLA Simulator Using Simulink and CARLA ROS Bridge
Emergency braking of ego vehicle in CARLA using Simulink.
모델 실행
- Enable External Mode for ROS Toolbox Models
External mode enables Simulink on your host computer to communicate with a deployed model on your robotics hardware during runtime. - Enable ROS Time Model Stepping for Deployed ROS Nodes
You can enable a deployed ROS node to execute based on the time published on the/clock
topic on a ROS network. - Tune Parameters and View Signals on Deployed Robot Models Using External Mode
External mode enables Simulink models on your host computer to communicate with a deployed model on your robot hardware during runtime. - Overrun Detection with Deployed ROS Nodes
You can enable overrun detection for a deployed ROS node.