Skip to content

Commit 889fb2a

Browse files
author
Julien Cassette
committed
Add 'Simulink/' from commit '550904cdd9c6b74d19b7c6fb04d3c0d2af25af41'
git-subtree-dir: Simulink git-subtree-mainline: 9700e3b git-subtree-split: 550904c
2 parents 9700e3b + 550904c commit 889fb2a

9 files changed

+64
-0
lines changed

Simulink/.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Windows default autosave extension
2+
*.asv
3+
4+
# OSX / *nix default autosave extension
5+
*.m~
6+
7+
# Compiled MEX binaries (all platforms)
8+
*.mex*
9+
10+
# Simulink Code Generation
11+
slprj/
12+
13+
# Session info
14+
octave-workspace
15+
16+
# Simulink autosave extension
17+
*.autosave

Simulink/README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# IMAV2017 Simulink models #
2+
3+
## Description ##
4+
5+
The [International Micro Air Vehicle Conference and Competition](http://www.imavs.org) (IMAV) is a yearly event that aims at fostering key technologies for the development of micro-air vehicles that [MathWorks](http://www.mathworks.com/) sponsors.
6+
IMAV combines a scientific conference and a flight competition intended to all research groups around the world.
7+
This project has been developed to provide IMAV with an environment for the virtual competition event, complementing the two real indoor and outdoor competitions.
8+
9+
## Contents ##
10+
11+
This repository contains Simulink control models that connect to the competition environment running on ROS/Gazebo in order to control a drone. This is done by sending ROS topics from Simulink, thanks to the ROS blocks from the Robotics System Toolbox.
12+
13+
Several example models are available for you to experiment with that and build up a drone control software that will allow to meet the mission elements:
14+
15+
- **manualControl**: control the drone manually on the X, Y, Z and Yaw axis
16+
- **simpleMovement**: make the drone reach a target (the QR code) by defining a trajectory with the Signal Builder block
17+
- **pathFollowing**: make the drone reach a target using the Pure Pursuit block from the Robotics System Toolbox
18+
- **pathFollowingWithObstacleAvoidance**: make the drone avoid obstacles using the Vector Field Histogram block from the Robotics System Toolbox
19+
20+
For the moment, these models control the drone with ID 1, but you can change the topics of the *Subscribe* and *Publish* blocks to control another drone.
21+
22+
## Instructions ##
23+
24+
To connect Simulink with the ROS server, follow these steps:
25+
26+
1. In MATLAB, execute the `rosinit` function with the IP of the virtual machine
27+
2. In Simulink, navigate to Tools > Robotics Operating System > Configure Network Addresses
28+
3. In ROS Master, make sure Network Address is set to Default
29+
4. In Node Host, make sure Network Address is set to Default
30+
5. Test the connectivity using the Test button
31+
32+
Refer to the following links for more information:
33+
34+
- [Connect to a ROS Network](https://www.mathworks.com/help/robotics/examples/connect-to-a-ros-network.html)
35+
- [Simulink and ROS Interaction](https://www.mathworks.com/help/robotics/ug/simulink-and-ros-interaction.html)
36+
- [Configure ROS Network Addresses](https://www.mathworks.com/help/robotics/ug/configure-ros-network-addresses.html)
37+
38+
## Notes ##
39+
40+
If a model can control the drone but does not receive any data from the drone, make sure you have set the *ROS_IP* environment variable in the VM before running ROS.

Simulink/license.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2017, The MathWorks, Inc.
2+
All rights reserved.
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
5+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
6+
3. In all cases, the software is, and all modifications and derivatives of the software shall be, licensed to you solely for use in conjunction with MathWorks products and service offerings.
7+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Simulink/manualControl.slx

41.1 KB
Binary file not shown.

Simulink/pathFollowing.slx

38.6 KB
Binary file not shown.
41.3 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

Simulink/simpleMovement.slx

36.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)