# Pure-MatSU
Pure-Matlab Simulation for UAVs
**Currently designed for fixed-wing UAVs only**
This simulator is written in pure Matlab, i.e. does not make use of Simulink.
It is a free-running simulation, meaning that it will execute as fast as it can, according to the capabilities of your system. It is not locked to a real-time clock.
It provides for fixed time-step with Forward-Euler integration, or the use of Matlab's ode45 and ode15s solvers.
Please use the version releases to ensure that your downloaded version is as bug-free as possible and has updated documentation.
## User Instructions
Follow these instructions to use this simulator:
1. **Load path**: Run the `load_path` script to setup the execution path
- **Edit simulation options**: Edit the `simulation_options` function and adjust the simulation parameters to your needs.
Ample documentation is provided inline. This is also where you can set the initialization options.
You can enable live plots and graphic output, but keep in mind that this places a significant burden to the system and slows the simulation down.
Finally, this is where you can select the simulated vehicle, by setting the `sim_options.vehicle` parameter to one of the contents of the `vehicles` folder, but only one model is currently available.
- (optional) **Edit vehicle parameters**: To change the model parameters of a vehicle, open its corresponding function from the `vehicles` folder. Currenlty only the `skywalker_2013` model is provided. Change any parameter value to your liking.
Specifically the `skywalker_2013` is modeled like the corresponding model from [last_letter](http://georacer.github.io/last_letter/parameters/aircraftParams.html) and more modeling information can be found in the [uav-modeling](https://github.com/Georacer/uav-modeling/blob/master/preamble.pdf) documenation.
- **Run simulation**: Run the `simulation` function (`sim_output = simulation(simulation_options())`) to generate the simulation output in the `sim_output` workspace struct variable. The vehicle states trajectory is saved in the `array_states` member. The input history is saved in the `array_inputs` member.
- **Plot resulting trajectory**: Run `plot_trajectory(sim_output, sim_options)` to plot the resulting trajectory. Read the function documentation for more graphics options.
## Writing a new controller
You can select the controller which will be applied on the simulated vehicle in the `simulation_options` function.
A controller is a function which is given the `VehicleState` instance and generates a 4x1 vector with the control inputs to the vehicle. The contents of this vector are:
1. Aileron input - range: [-1,1]
1. Elevator input - range: [-1,1]
1. Throttle input - range: [0,1]
1. Rudder input - range: [-1,1]
and obviously correspond to vehicles with the airplane form.
By default, the option is set to 0, corresponding to the `StaticOutput` controller. This controller generates a constant, zero output for all four inputs.
To write your own controller, first create a new controller function in the `controllers` folder. Use the `StaticOutput` controller as a template.
Your controller class must have at least a constructor to initialize itself and a method `ctrl_output = calc_output(sim_vehicle, t)` with the same signature as the one in `StaticOutput`.
Then, edit the `Controller` class to assign an index to your controller and add an option for it in the class constructor. This is also where you will setup any initialization options for your controller.
Finally, edit the `simulation_options` function and set your new controller index in the `sim_options.controller.type` field, along with any other required parameters.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计&课设-无人机的纯Matlab仿真.zip (26个子文件)
Pure-MatSU-master
simulation_options.m 3KB
load_path.m 183B
controllers
Controller.m 2KB
StaticOutput.m 2KB
tests
test_script.m 1KB
visualization
plot_trajectory.m 2KB
plot_states.m 10KB
draw_aircraft_body.m 943B
draw_aircraft.m 3KB
plot_forces.m 4KB
utilities
Supervisor.m 19KB
Trimmer.m 11KB
Kinematics.m 9KB
VehicleState.m 8KB
changelog.txt 771B
models
Propulsion.m 5KB
Gravity.m 2KB
Aerodynamics.m 10KB
Environment.m 3KB
.gitignore 24B
vehicles
graphics
airplane_1.m 2KB
lucas.m 4KB
Vehicle.m 6KB
skywalker_2013.m 3KB
README.md 4KB
simulation.m 6KB
共 26 条
- 1
资源评论
毕业小助手
- 粉丝: 2080
- 资源: 1712
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- v2.1.6-Unity3D插件 SUIMONO Water System 效果逼真交互水系统
- 基于STM32 Discovery(STM32f407vgt6)Discovery板的STM32裸机项目集合
- mmexport1717246170188.jpg
- 近代史调查问卷_统计报表_20240601205759.xlsx
- v2.1.2-Unity3D插件 SUIMONO Water System 效果逼真交互水系统
- 农村小别墅图纸编号D040-三层-08.30&14.60米-施工图.dwg
- 三层别墅图纸编号D039-三层-16.70&14.70米- 结构图.dwg
- 三层农村小别墅编号D038-三层-11.90&13.50米-施工图.dwg
- 采购组·主管业务原型集与说明(Xmind书写)
- 三层图纸编号D037-三层-10.40&15.10米-施工图.dwg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功