cd ~/
sudo apt install git
git clone https://github.com/ArduPilot/ardupilot.git
cd ardupilot
git checkout Copter-3.6
git submodule update --init --recursive
sudo apt-get update -y
sudo apt-get install -y ros-melodic-mavros geographiclib-tools python-matplotlib python-serial python-wxgtk3.0 python-wxtools python-lxml python-scipy python-opencv ccache gawk python-pip python-pexpect
sudo geographiclib-get-geoids egm96-5
sudo pip install future pymavlink MAVProxy
cd ~
git clone https://github.com/khancyr/ardupilot_gazebo.git
cd ardupilot_gazebo
git checkout dev
mkdir build
cd build
cmake .. make -j4
sudo make install
cd ~/catkin_ws/src/
git clone https://github.com/Roboaries/MP_DR_T8
catkin_make
Add to .bashrc or .zshrc and reload (This step is very important to ensure that gazebo finds the models and your terminal finds the sim_vehicle.py script)
export PATH=$PATH:$HOME/ardupilot/Tools/autotest:/usr/lib/ccache
export GAZEBO_RESOURCE_PATH=${GAZEBO_RESOURCE_PATH}:$HOME/ardupilot_gazebo/worlds
export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:$HOME/ardupilot_gazebo/models
export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:$HOME/catkin_ws/src/MP_DR_T8-main/MP_DR_T8-main/interiit22/interiit22/models
Launch the simulation for world 1 (for running world 2 , change the launch file name to "drdo_world2.launch")
roslaunch interiit22 drdo_world1.launch
cd ~/ardupilot/ArduCopter/ && sim_vehicle.py -v ArduCopter -f gazebo-iris --console
rosrun interiit22 ugv_nav.py
rosrun interiit22 drone_nav.py
- The line
contours,hierarchy=cv2.findContours()
may give an error: too many values to unpack, because the functioncv2.findContours()
returns 2 or 3 values depending on the python version. If the script gives an error , just add an extra argument:_,contours,hierarchy=cv2.findContours()
- The spawn location of the UAV has been changed slightly, (within 5 meters of the UGV), to aid in takeoff.
- The range of the depth camera has been increased, but the FOV has not been changed (in accordance with the rules).
- Some paths/URIs in the .launch and the .world files may need to be changed according to one's own directory structure.