|
|
|
Reference: https://raw.githubusercontent.com/Texas-Aerial-Robotics/Controls-ROS/master/README.md
|
|
|
|
|
|
|
|
## Install Gazebo
|
|
|
|
|
|
|
|
Setup your computer to accept software from http://packages.osrfoundation.org:
|
|
|
|
```
|
|
|
|
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
|
|
|
|
```
|
|
|
|
|
|
|
|
Setup keys:
|
|
|
|
```
|
|
|
|
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
|
|
|
|
```
|
|
|
|
|
|
|
|
Reload software list:
|
|
|
|
```
|
|
|
|
sudo apt update
|
|
|
|
```
|
|
|
|
|
|
|
|
Install Gazebo:
|
|
|
|
```
|
|
|
|
sudo apt install gazebo9 libgazebo9-dev
|
|
|
|
```
|
|
|
|
|
|
|
|
Install ROS plugins:
|
|
|
|
```
|
|
|
|
sudo apt install ros-melodic-gazebo-ros ros-melodic-gazebo-plugins
|
|
|
|
```
|
|
|
|
|
|
|
|
Get Gazebo plugin for APM (ArduPilot Master):
|
|
|
|
```
|
|
|
|
cd ~
|
|
|
|
git clone https://github.com/SwiftGust/ardupilot_gazebo
|
|
|
|
cd ardupilot_gazebo
|
|
|
|
git checkout gazebo9
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake ..
|
|
|
|
make -j4
|
|
|
|
sudo make install
|
|
|
|
```
|
|
|
|
|
|
|
|
Set paths for models:
|
|
|
|
```
|
|
|
|
echo 'export GAZEBO_MODEL_PATH=~/ardupilot_gazebo/gazebo_models' >> ~/.bashrc
|
|
|
|
. ~/.bashrc
|
|
|
|
```
|
|
|
|
|
|
|
|
Add Gazebo Models:
|
|
|
|
```
|
|
|
|
hg clone https://bitbucket.org/osrf/gazebo_models ~/gazebo_ws/gazebo_models
|
|
|
|
cd ~/gazebo_ws/gazebo_models
|
|
|
|
echo 'export GAZEBO_MODEL_PATH=~/gazebo_ws/gazebo_models' >> ~/.bashrc
|
|
|
|
source ~/.bashrc
|
|
|
|
```
|
|
|
|
|
|
|
|
## 8. Run Simulator With Gazebo
|
|
|
|
|
|
|
|
In one Terminal (Terminal 1), run SITL:
|
|
|
|
```
|
|
|
|
cd ~/ardupilot/ArduCopter/
|
|
|
|
sim_vehicle.py -j4 -f Gazebo --console
|
|
|
|
```
|
|
|
|
|
|
|
|
In another Terminal (Terminal 2), run Gazebo:
|
|
|
|
```
|
|
|
|
gazebo --verbose ~/ardupilot_gazebo/gazebo_worlds/iris_irlock_demo.world
|
|
|
|
``` |
|
|
|
\ No newline at end of file |