Testing Drone Simulation in docker
You can find these installation instructions here.
Install docker using convenience script
sudo apt-get install curl
curl -fsSL get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo groupadd docker
# Add your user to the docker group.
sudo usermod -aG docker $USER
# Restart computer to see effects
mkdir -p drone/home
xhost +
docker run -it --privileged --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" -v ~/drone/home:/home/:rw --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" -p 14556:14556/udp --name=drone avi241/drone-pc bash
gazebo
If gazebo is unable to run you need to install the nvidia drivers specific to your system . Follow the below steps.
exit
docker stop drone
docker rm drone
sudo rm -r ~/drone
mkdir -p drone/home
xhost +
docker run -it --privileged --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" -v ~/drone/home:/home/:rw --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" -p 14556:14556/udp --name=drone avi241/xtdrone bash
apt-get update
apt-get install ubuntu-drivers-common
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
ubuntu-drivers devices
ubuntu-drivers autoinstall
gazebo
docker exec -it drone bash
roslaunch px4 indoor3.launch
roslaunch hector_slam_launch hector_slam_xtdrone.launch
cd ~/XTDrone/communication/
python multirotor_communication.py iris 0
cd ~/XTDrone/sensing/slam/laser_slam/script/
python laser_transfer.py iris 0 2d
cd ~/XTDrone/control/keyboard/
python multirotor_keyboard_control.py iris 1 vel
roslaunch px4 outdoor1.launch
roslaunch aloam_velodyne aloam_velodyne_HDL_32.launch
cd ~/XTDrone/sensing/slam/laser_slam/script
python laser_transfer.py iris 0 3d
cd ~/XTDrone/communication
python multirotor_communication.py iris 0
cd ~/XTDrone/control/keyboard
python multirotor_keyboard_control.py iris 1 vel
increse the upward speed greater than 0.30 by pressing i
press b for offboard
press t to arm the drone
drone will rise to some height now press s to hover.
now control the direction of drone with w,x,a,d (forward,backward,left,right)
press s to stop it to any position.