# Getting Started with MATLAB, Simulink, and ROS
Copyright 2017-2019 The MathWorks, Inc.
## Getting Started
This repository contains resources for getting started with MATLAB and Simulink
and the Robot Operating System (ROS). This functionality is provided by ROS Toolbox.
To learn more, refer to our [blog post](https://blogs.mathworks.com/racing-lounge/2017/11/08/matlab-simulink-ros/) and the following videos.
* [Getting Started with MATLAB and ROS](https://www.mathworks.com/videos/matlab-and-simulink-robotics-arena-getting-started-with-matlab-and-ros-1508263034047.html)
* [Getting Started with Simulink and ROS](https://www.mathworks.com/videos/matlab-and-simulink-robotics-arena-getting-started-with-simulink-and-ros-1509397202143.html)
* [Deploying Standalone ROS Nodes from Simulink](https://www.mathworks.com/videos/matlab-and-simulink-robotics-arena-deploying-algorithms-to-ros-1510659362460.html)
* [Distributed Computing with MATLAB, Simulink, and ROS](https://www.mathworks.com/videos/matlab-and-simulink-robotics-arena-designing-distributed-systems-with-ros-1514584072926.html)
## templateFiles Folder
Contains files provide a basic structure for creating your own MATLAB and Simulink files.
### MATLAB Templates
* **loopTemplate:** Algorithm runs in a simple loop, with an optional pause between iterations
* **rateTemplate:** Algorithm runs in a simple loop, which runs at a fixed rate dictated by either the wall clock or the global ROS node clock
* **async/asyncTemplate:** Algorithm runs asynchronously, whenever a new ROS message is received
* **timer/timerTemplate:** Algorithm is scheduled to run on a timer in the background
### Simulink Templates
* **simulationTemplate:** Model is slowed down using the wall clock, to run approximately in real time
* **codeGenerationTemplate:** Model is configured to generate a standalone C++ ROS node using Embedded Coder
* **multirateTemplate:** Model contains multiple subscribe and algorithm rates, as well as displays the color-coded rates in the model
* **architecture/mdlArchTemplate:** Model contains MATLAB, Simulink, and Stateflow elements. Links to reusable MATLAB files and Simulink block library in the **architecture** folder
* **paramServerGetterTemplate + paramServerSetterTemplate**: The "getter" model can run on the desktop or deployed standalone, and receives parameters from the ROS parameter server. To modify the parameter value, you can either run the "setter" model, or use **rosparam** in MATLAB or a Terminal window.
## demoFiles Folder
Contains filled out versions of the templates above, that will run on several platforms.
### Algorithms
#### Object Detection
* Uses camera information to detect a blue object and return its position and size
* MATLAB code can be found in **Algorithms\detectCircle.m**
* The same function is called in the Simulink examples using a MATLAB Function block
#### Object Tracking
* Uses the output of the object detection algorithm to assign linear and angular velocities such that the object is centered in the field of vision and has a certain pixel size (or distance)
* MATLAB code can be found in **Algorithms\trackCircle.m**
* Simulink and Stateflow versions of the same algorithm can be found in **Algorithms\controlLib.slx**
### Target Platforms
#### Webcam
These examples have been tested on Windows using the MATLAB Support Package for USB Webcams at https://www.mathworks.com/matlabcentral/fileexchange/45182-matlab-support-package-for-usb-webcams
#### Gazebo Examples
These examples have been tested using the Linux virtual machine at https://www.mathworks.com/support/product/robotics/v3-installation-instructions.html.
When you open the virtual machine, you can track blue objects in either the **Gazebo Playground** or **Gazebo TurtleBot World** worlds. To test the tracking algorithm, you can use Gazebo to move the robot and/or the blue objects in the world.
#### TurtleBot
These examples have been tested using the TurtleBot 2.
You can find a printable blue circle in the **Images** folder.
### MATLAB Examples
The **MATLAB** subfolder contains loop examples, as well as a **timer** subfolder showing the timer object and handle class approach.
### Simulink Examples
The **Simulink** subfolder contains examples with Simulink blocks, with Simulink blocks and a Stateflow chart, and using External Mode and the ROS Parameter Server (see the **paramServer** subfolder).
In addition, the **distributed** subfolder contains examples of the perception, control, and visualization components broken into multiple tasks and separate models. The models can communicate with each other with a standard ROS message or with a custom message which can be found in the **custom_robot_msgs** folder. To get the latter example working, you will need to use the ROS Toolbox Interface for ROS Custom Messages add-on and follow the steps shown at https://www.mathworks.com/help/ros/ug/ros-custom-message-support.html

毕业小助手
- 粉丝: 2768
- 资源: 5583
最新资源
- ASP.NET MVC 程序设计.zip(毕设&课设&实训&大作业&竞赛&项目)
- GRU-Attention混合模型MATLAB代码实现:基于门控循环单元与注意力机制融合的数据分类预测技术,便捷读取EXCEL数据的主程序解决方案,基于GRU-Attention融合机制的数据分类预测
- 基于Python3.8.2+PyQt5 5.14.2开发的跨平台(MacOS、Windows、Linux)的简单文件加解密工具。采用RSA非对称加密算法,使用公钥加密私钥解密(毕设&课设&实训&大作业
- Matlab中的函数寻优方法:结合遗传算法与非线性规划算法的优点实现全局最优解,结合遗传算法与非线性规划的全局与局部搜索最优解求解方法实践,Matlab基于遗传算法和非线性规划的函数寻优方法 本案例
- THREE 平台化的项目,目前已适配微信,淘宝,头条小程序,微信小游戏.zip(毕设&课设&实训&大作业&竞赛&项目)
- 基于Unity的2D动作平台游戏。.zip(毕设&课设&实训&大作业&竞赛&项目)
- DeepSeek 总是提示“服务器繁忙”怎么办?10余种方法超详细图文教你一步到位使用DeepSeek-R1-满血版
- 基于边缘计算的资源卸载与群智能优化算法定制设计,基于边缘计算的资源卸载与群智能优化算法设计研究,基于边缘计算的资源卸载 群智能优化算法定做,算法设计 ,基于边缘计算的资源卸载; 群智能优化算法; 算法
- 基于CNN,RNN 和NLP中预训练模型构建的多个常见的文本分类模型。(毕设&课设&实训&大作业&竞赛&项目)
- 汽车稳定性滑模控制系统的MATLAB仿真研究:含不同控制器效果、参数对比及整车动力学模型m文件与参考资料分析,汽车稳定性滑模控制系统的Matlab仿真研究:不同控制器效果与参数对比分析,附整车动力学模
- 基于grpc+dubbo+springboot开发的分布式服务.zip(毕设&课设&实训&大作业&竞赛&项目)
- chrome 最新133.0.6943.99稳定版.zip
- 光热电站考虑N-K安全约束的风电、光伏电力系统优化调度模型研究与实践(仿真测试表现良好),光热电站下的风电-光伏电力系统N-k安全优化调度策略与实战案例解析:弃风弃光问题及调度策略对比,含风电-光伏
- 基于SpringBoot+MyBatis Plus++Shiro+jwt+redis+rabbitMQ+ElasticSearch+vue+ElementUI的个人博客项目(毕设&课设&实训&大作业&
- 仿OFO官网的HTML+CSS项目训练.zip(毕设&课设&实训&大作业&竞赛&项目)
- 基于S7-200 PLC与MCGS组态的苹果分拣机控制系统设计与实现:探究程序设计与组态王的应用,基于西门子S7-200 PLC与MCGS组态王的苹果分拣机控制系统设计与实现,41#西门子S7-200
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


