CSE2040 Exp-3 20BRS1217

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Lab experiment - 3

Name: Vignesh
Surendran
Reg. No.: 20BRS1217
Subject: drone appls, components & assembly
Subject code: CSE2040
Professor: Dr. V Muthumanikandan
Slot: L43+L44
Give step-by-step procedure for installing the simulation for drones along
with prerequisites. It should be a complete manual for someone who wishes
to install drone simulation software. Give respective screenshots for
successful installation.

Follow the given steps for successful simulation of a drone:

1. We first install the required dependencies like CMake and git


sudo apt update && \
sudo apt install -y software-properties-common lsb-release && \
sudo apt clean all
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc
2>/dev/null | gpg --dearmor - | sudo tee
/etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/
$(lsb_release -cs) main" sudo apt update
sudo apt install kitware-archive-keyring
sudo rm /etc/apt/trusted.gpg.d/kitware.gpg
sudo apt update
sudo apt install cmake -y
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y

sudo apt-get install git zip cmake build-essential genromfs ninja-


build exiftool astyle -y pip3 install argparse empy toml numpy
pip3 install pandas jinja2 pyserial pyyaml
pip3 install pyulog

2. Installing ROS and Gazebo


sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu
$(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-
key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

## For keyserver connection problems substitute hkp://pgp.mit.edu:80


or hkp://keyserver.ubuntu.com:80 above.
sudo apt-get update
## Get ROS/Gazebo

sudo apt install ros-noetic-desktop-full -y ## Initialize rosdep


sudo rosdep init
rosdep update

## Setup environment variables


rossource="source /opt/ros/noetic/setup.bash"
if grep -Fxq "$rossource" ~/.bashrc; then echo ROS setup.bash
already in .bashrc; else echo "$rossource" >> ~/.bashrc; fi
eval $rossource

## Install rosinstall and other dependencies


sudo apt install python3-rosdep python3-rosinstall python3-
rosinstall-generator python3-wstool build-essential -y
# MAVROS: https://dev.px4.io/en/ros/mavros_installation.html
## Install dependencies
sudo apt-get install python3-catkin-tools python3-rosinstall-
generator -y #sudo apt-get install ros-noetic-geographic_info -y
sudo apt-get install ros-noetic-geographic-msgs -y
sudo apt-get install libgeographic-dev ros-noetic-geographic-msgs -y

pip3 install catkin_pkg pip3 install empy

## Create catkin workspace mkdir -p ~/catkin_ws/src


cd ~/catkin_ws
catkin init

wstool init src

## Install MAVLink
###we use the Kinetic reference for all ROS distros as it's not
distro-specific and up to date
rosinstall_generator --rosdistro kinetic mavlink | tee
/tmp/mavros.rosinstall
## Build MAVROS
### Get source (upstream - released)
rosinstall_generator --upstream mavros | tee -a
/tmp/mavros.rosinstall

3. We will now setup the workspace


#Install geographiclib
sudo apt install geographiclib-tools -y
echo "Downloading dependent script
'install_geographiclib_datasets.sh'"
# Source the install_geographiclib_datasets.sh script directly from
github install_geo=$(wget
https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scrip
ts/install_geogra phiclib_datasets.sh -O -)
wget_return_code=$?
# If there was an error downloading the dependent script, we must
warn the user and exit at this point.
if [[ $wget_return_code -ne 0 ]]; then echo "Error downloading
'install_geographiclib_datasets.sh'. Sorry but I cannot proceed
further :("; exit 1; fi
# Otherwise source the downloaded script.
sudo bash -c "$install_geo"
## Build!
catkin build
## Re-source environment to reflect new packages/build environment
catkin_ws_source="source ~/catkin_ws/devel/setup.bash"
if grep -Fxq "$catkin_ws_source" ~/.bashrc; then echo ROS catkin_ws
setup.bash already in .bashrc;
else echo "$catkin_ws_source" >> ~/.bashrc; fi
eval $catkin_ws_source
4. We will now download the QGroundControl to control the drone.
sudo usermod -a -G dialout $USER

sudo apt-get remove modemmanager -y

sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-libav


gstreamer1.0-gl -y

sudo apt install libqt5gui5 -y

sudo apt install libfuse2 -y

Download the image file from the official website

chmod +x ./QGroundControl.AppImage ./QGroundControl.AppImage


5. We will now download the PX4 code

6. We will now run Gazebo, PX4 and QGroundControl


Working of the PX4 in Gazebo

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy