GAPTER: Set-up GapterSim Environment¶
A. Prerequisites¶
- Ubuntu 14.04 LTS (Trusty Tahr)
- Ros indigo
Configure Ubuntu
sudo apt-get update
sudo apt-get install gawk make git curl cmake -y
ROS dependencies and required packages:
sudo apt-get install python-rosinstall ros-indigo-octomap-msgs ros-indigo-joy ros-indigo-geodesy ros-indigo-octomap-ros ros-indigo-mavlink ros-indigo-control-toolbox ros-indigo-transmission-interface ros-indigo-joint-limits-interface unzip ros-indigo-mavros-msgs ros-indigo-mavros-extras ros-indigo-mavros -y
Mavproxy
Install dependencies
sudo apt-get install g++ python-pip python-matplotlib python-serial python-wxgtk2.8 python-scipy python-opencv python-numpy python-pyparsing ccache realpath libopencv-dev -y
Install MavProxy
sudo pip install future
sudo apt-get install libxml2-dev libxslt1-dev -y
sudo pip2 install pymavlink catkin_pkg --upgrade
sudo pip install MAVProxy==1.5.2
B. Ardupilot¶
mkdir -p ~/gapter_sim
cd gapter_sim
git clone https://github.com/gaitech-robotics/gapter_ardupilot -b sim_ros_gazebo
C. Creating ros work space¶
mkdir -p ~/gapter_sim/ros_ws/src
cd ~/gapter_sim/ros_ws/src
catkin_init_workspace
cd ..
catkin_make
Now download all repositories required
cd src/
git clone https://github.com/gaitech-robotics/gapter_ardupilot_sitl_gazebo_plugin
git clone https://github.com/gaitech-robotics/gapter_rotors_simulator -b sonar_plugin
git clone https://github.com/PX4/mav_comm.git
git clone https://github.com/ethz-asl/glog_catkin.git
git clone https://github.com/catkin/catkin_simple.git
git clone https://github.com/gaitech-robotics/mavros
git clone https://github.com/tu-darmstadt-ros-pkg/hector_gazebo/
git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b indigo-devel
D. Installing Gazebo¶
Setup your computer
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 -
Install gazebo
sudo apt-get update
sudo apt-get remove '.*gazebo.*' '.*sdformat.*' '.*ignition-math.*'
sudo apt-get update
sudo apt-get install gazebo4 libgazebo4-dev drcsim -y
E. Compile workspace¶
source ~/gapter_sim/ros_ws/devel/setup.bash
cd ~/gapter_sim/ros_ws
catkin_make --pkg mav_msgs mavros_msgs gazebo_msgs
source devel/setup.bash
catkin_make -j 4
F. launch Gapter Simulation¶
Open the terminal and type following:
source ~/gapter_sim/ros_ws/devel/setup.bash
user $: cd ~/gapter_sim/gapter_ardupilot/ArduCopter
user $: ../Tools/autotest/sim_vehicle.sh -j 4 -f Gazebo
In another terminal lauch following:
source ~/gapter_sim/ros_ws/devel/setup.bash
roslaunch ardupilot_sitl_gazebo_plugin gapter_spawn.launch
Once mavproxy launched completely in the first terminal load parameters from Ardupilot directory
param load /your home directory/gapter_sim/gapter_ardupilot/Tools/Frame_params/gapter.param
param set ARMING_CHECK 0
Takeoff gapter
In mavproxy terminal type following:
mode Guided
arm throttle
takeoff 5
You can see in gazebo that gapter flying at 5 meter height.