├── Tutorial to setup SITL Gazebo on Windows - v0.8.pdf ├── Tutorial to setup SITL Gazebo on Windows - v0.8.docx ├── scripts ├── step_6_install_control_example.sh ├── step_2_create_shared_folder.sh ├── step_1_configure_ubuntu.sh ├── step_3_install_arducopter.sh ├── step_5_create_ros_workspace.sh └── step_4_install_ros.sh ├── Personal notes ├── 2.script_compile_mavlink.sh ├── 6.In the simulation.txt ├── 3.compile-install MavProxy.txt ├── 2.info.details.mavlink.txt ├── 2.Compile Mavlink.txt ├── 4.install_eclipse.sh ├── 1.Guideline.txt ├── step_scripts │ ├── step_1_configure_ubuntu.sh │ ├── step_3_install_arducopter.sh │ ├── step_5_create_ros_workspace.sh │ └── step_4_install_ros.sh ├── 5.Launch ArduPilot_Gazebo.txt ├── 4.Setup Eclipse Linux.txt └── 0.FR_softs_utiles.txt ├── .gitattributes ├── .gitignore └── README.md /Tutorial to setup SITL Gazebo on Windows - v0.8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AurelienRoy/ardupilot_sitl_ros_tutorial/HEAD/Tutorial to setup SITL Gazebo on Windows - v0.8.pdf -------------------------------------------------------------------------------- /Tutorial to setup SITL Gazebo on Windows - v0.8.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AurelienRoy/ardupilot_sitl_ros_tutorial/HEAD/Tutorial to setup SITL Gazebo on Windows - v0.8.docx -------------------------------------------------------------------------------- /scripts/step_6_install_control_example.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | sudo apt-get install ros-indigo-ar-track-alvar 5 | 6 | roscd 7 | cd ../src #Navigate in your ROS user source files directory 8 | git clone https://alexbuyval@bitbucket.org/alexbuyval/um_pixhawk.git 9 | 10 | 11 | -------------------------------------------------------------------------------- /Personal notes/2.script_compile_mavlink.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd ~/shared_sitl/ardupilot 4 | ./libraries/GCS_MAVLink/generate.sh 5 | 6 | cd ~/shared_sitl/mavlink-gbp-release 7 | sed 's|\(2014.11.11-3trusty\)|\1-custom|' -i debian/changelog 8 | fakeroot dpkg-buildpackage -us -uc -b 9 | cd .. 10 | sudo dpkg -i ./ros-indigo-mavlink_2015.11.25-0trusty_amd64.deb 11 | 12 | 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /Personal notes/6.In the simulation.txt: -------------------------------------------------------------------------------- 1 | Once Launched: 2 | 3 | In the first console Nautilus you will get mavproxy values. You can control the drone in this terminal with MavProxy console commands (for example module load map, module load console, rc 3 1500, module load graph, graph WIND.direction, graph timespan60,output add 192.168.1.31:14551) 4 | On the second console (Xterm) you will get gazebo launch datas 5 | 6 | On another terminal you can launch RVIZ which catch topic to show datas like camera footages 7 | : rviz, add, By topic /recorder_cam OK 8 | -------------------------------------------------------------------------------- /Personal notes/3.compile-install MavProxy.txt: -------------------------------------------------------------------------------- 1 | 2 | Issued from MavProxy's master branch on: 14-10-2015 3 | 4 | 5 | 6 | To compile it: 7 | 8 | cd ~/shared_sitl/MAVProxy 9 | python setup.py build install --user 10 | 11 | 12 | To run it: 13 | 14 | cd ~/shared_sitl/MavProxy/MAVProxy/build/scripts-2.7 15 | ./mavproxy.py --version 16 | 17 | For Gazebo 18 | ./mavproxy.py --master 127.0.0.1:14550 --out 192.168.1.30:14551 --console --map --aircraft aircraft_ros 19 | 20 | For SITL 21 | mavproxy.py --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --out 127.0.0.1:14550 --out 127.0.0.1:14551 --map --console 22 | 23 | http://dronecode.github.io/MAVProxy/html/development/mavdevenv.html 24 | 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ardupilot_sitl_ros_tutorial 2 | Tutorial for the setup of ROS Gazebo SITL for Ardupilot 3 | 4 | It contains automation scripts and a tutorial to help follow the instructions from: 5 | 6 | http://dev.ardupilot.com/wiki/using-rosgazebo-simulator-with-sitl/ 7 | 8 | 9 | The whole setup process is described in "Tutorial to setup SITL Gazebo on Windows - vX.X.pdf". 10 | It is intended for Windows users, for it starts with the setup of a virtual machine on VMWare. Still, if you already are on Linux the 2nd part will interest you. 11 | 12 | The scripts are located in the 'scripts' folder. 13 | To run them, do not forget to run "chmod +x ./*.sh" in their directory, to authorize their execution. 14 | 15 | Hopefully it will help you setup your simulation environment ! 16 | -------------------------------------------------------------------------------- /Personal notes/2.info.details.mavlink.txt: -------------------------------------------------------------------------------- 1 | Mavlink version from 19/10/2015 2 | https://github.com/mavlink/mavlink 3 | 4 | compile / install : 5 | 6 | cd pymavlink 7 | sudo python setup.py install 8 | 9 | 10 | 11 | compile and install (in ROS directory) : 12 | 13 | cd ~/px4/MavLink-gndStation/mavlink2/mavlink-gpb-release 14 | sed 's|\(2014.11.11-3trusty\)|\1-custom|' -i debian/changelog 15 | fakeroot dpkg-buildpackage -us -uc -b 16 | cd .. 17 | sudo dpkg -i ./ros-indigo-mavlink_2015.10.10-0trusty_amd64.deb 18 | 19 | and then do a 20 | catkin_make 21 | to recompile ROS 22 | 23 | https://github.com/mavlink/mavros/issues/166 24 | http://unix.stackexchange.com/questions/159094/install-from-a-deb-file-by-dpkg-i-or-by-apt 25 | 26 | 27 | 28 | git clone https://github.com/mavlink/mavlink-gbp-release.git -b debian/indigo/trusty/mavlink 29 | cd mavlink-gpb-release 30 | <<< copy your messege definitions or edit >>> 31 | 32 | 33 | -------------------------------------------------------------------------------- /Personal notes/2.Compile Mavlink.txt: -------------------------------------------------------------------------------- 1 | 2 | ArduCopter side: 3 | modify the file "ardupilotmega.xml" on "ardupilot/libraries/GCS_MAVLink/message_definitions" 4 | 5 | in a terminal, type: 6 | cd ~/shared_sitl/ardupilot 7 | ./libraries/GCS_MAVLink/generate.sh 8 | 9 | then modify the Ardu code in file GCS_Mavlink.cpp. 10 | 11 | 12 | Ground station side, python: 13 | modify the file "ardupilotmega.xml" on "MavLink-gndStation/mavlink2/mavlink-gbp-release/message_definitions/v1.0" 14 | 15 | compile and install (in ROS directory) : 16 | 17 | cd ~/shared_sitl/MavLink-gndStation/mavlink2/mavlink-gbp-release 18 | sed 's|\(2014.11.11-3trusty\)|\1-custom|' -i debian/changelog 19 | fakeroot dpkg-buildpackage -us -uc -b 20 | cd .. 21 | sudo dpkg -i ./ros-indigo-mavlink_2015.10.10-0trusty_amd64.deb 22 | 23 | and then do a 24 | catkin_make 25 | to recompile ROS 26 | 27 | 28 | 29 | _____________________________________________________ 30 | OBSOLETE: 31 | Ground station side, python: 32 | modify the file "ardupilotmega.xml" on "MavLink-gndStation/mavlink/message_definitions/v1.0" 33 | 34 | in a terminal, type: 35 | cd ~/px4/MavLink-gndStation/mavlinkpymavlink 36 | sudo python setup.py install 37 | 38 | 39 | build folders are: 40 | /usr/local/lib/python2.7/dist-packages/pymavlink 41 | /opt/ros/indigo/lib/python2.7/dist-packages/pymavlink 42 | 43 | -------------------------------------------------------------------------------- /scripts/step_2_create_shared_folder.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------- 3 | # Purpose: 4 | # Creates a shared folder with Windows. 5 | # Before running this script, you should have added on VMWare 6 | # a folder to be shared, and you should have mounted the VMware 7 | # Tools cdrom. 8 | #---------------------------------------------------------- 9 | # During the installation, accept all questions ! 10 | 11 | 12 | # Absolute path where will be placed the (symbolic links to) 13 | # shared folders. 14 | #DIR_FOR_SHARED_FOLDERS=~ 15 | 16 | # Stops at the first error it encounters 17 | set -e 18 | 19 | cd /mnt 20 | sudo rm -rf VMwareTools 21 | sudo rm -rf cdrom 22 | 23 | # Copies the TAR ball from the cd to a new directory 24 | sudo cp -r /media/apm/VMware\ Tools/ /mnt/cdrom 25 | # Expands the TAR ball in /mnt 26 | cd /mnt 27 | sudo tar zxf /mnt/cdrom/VMwareTools-*.tar.gz 28 | 29 | # Runs it 30 | cd /mnt/vmware-tools-distrib 31 | sudo perl ./vmware-install.pl 32 | 33 | #cd $DIR_FOR_SHARED_FOLDERS 34 | cd ~ 35 | vmware-hgfsclient 36 | 37 | echo "Checking that shared folders exists..." 38 | # Checks if any file exists in /mnt/hgfs 39 | if [ `ls /mnt/hgfs` ] 40 | then 41 | echo "Successful" 42 | ls /mnt/hgfs 43 | else 44 | # Recovery attempt 45 | sudo vmware-config-tools.pl 46 | if [ `ls /mnt/hgfs` ] 47 | then 48 | echo "Successful (on 2nd attempt)" 49 | ls /mnt/hgfs 50 | else 51 | # Failed to set the shared folders, exits 52 | echo "FAILED !" 53 | echo "Try a manual setup by running the commands one by one" 54 | ls /mnt/hgfs 55 | exit 1 56 | fi 57 | fi 58 | 59 | # Creates a symbolic link in /home/apm 60 | #cd $DIR_FOR_SHARED_FOLDERS 61 | cd ~ 62 | ln -s /mnt/hgfs/*/ 63 | 64 | # Removes temporary files 65 | sudo rm -rf /mnt/cdrom 66 | #umount /media/apm/VMware\ Tools/ 67 | 68 | -------------------------------------------------------------------------------- /Personal notes/4.install_eclipse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Aurelien Roy 3 | # 11/09/2015 4 | 5 | # From: 6 | # http://askubuntu.com/questions/26632/how-to-install-eclipse 7 | # Run it next to Eclipse's archive (.tar.gz) 8 | 9 | # Stops at the first error it encounters 10 | #set -e 11 | 12 | ECLIPSE_VERSION=eclipse-cpp-mars 13 | DESKTOP_SHORTCUT=~/Bureau/Eclipse.desktop 14 | 15 | echo "Installation of $ECLIPSE_VERSION" 16 | 17 | # Extracts the eclipse.XX.YY.tar.gz using 18 | tar -zxvf $ECLIPSE_VERSION*.tar.gz 19 | 20 | # Renames the extracted folder 21 | # (it supposes the extracted name is "eclipse") 22 | sudo mv eclipse $ECLIPSE_VERSION 23 | 24 | # Copies the eclipse folder to /opt 25 | sudo mv $ECLIPSE_VERSION /opt 26 | 27 | # Creates a shortcut on the desktop 28 | cat >$DESKTOP_SHORTCUT <> cd ~/ 6 | >> git clone https://github.com/AurelienRoy/ardupilot_sitl_ros_tutorial.git 7 | 8 | Inthis folder you will find all the instrucitons and the steps to install Gazebo Ros and Ardupilot. 9 | Launch step1, step3 (ArduPilot), step4 (ROS), step5 (ROS WorkSpace) in folder and replace git repositories by ours. 10 | Add in the step 5 the Hector_Lib repository clone 11 | 12 | Nota: Sometimes the access rights of files and folders are not granted, 13 | do : >> chmod +x ./*.sh 14 | 15 | ------------------------------------ 16 | Get the folders : 17 | 18 | Go to https://github.com/AurelienRoy and get the projects ardupilot, mavlink, MAVProxy : 19 | 20 | >> cd ~/shared_sitl 21 | >> git clone https://github.com/AurelienRoy/MAVProxy.git --branch map_overlay 22 | >> git clone https://github.com/AurelienRoy/ardupilot.git --branch wall_follow 23 | >> git clone https://github.com/AurelienRoy/mavlink-gbp-release.git --branch wall_follow 24 | >> git clone https://github.com/AurelienRoy/ardupilot_sitl_gazebo_plugin.git 25 | 26 | ------------------------------------ 27 | Compile MAVLink : 28 | 29 | Launch "2.script_compile_mavlink.sh" 30 | Be Carefull, the name "ros-indigo-mavlink_2015.25.11-0trusty_amd64.deb" could differ. Its folder is ~/shared_sitl. Modify the .sh et relaunch the script 31 | 32 | 33 | ------------------------------------ 34 | Compile MAVProxy : 35 | 36 | Open the file "3.compile-install MavProxy.txt" et follow the instructions 37 | 38 | ------------------------------------ 39 | Install Eclipse : 40 | Install Eclipse: Follow the instructions from "4.Setup Eclipse Linux.txt", and use the script "4.install_eclipse.sh". 41 | 42 | ----------------------------------- 43 | Compile ros 44 | >> roscd 45 | >> cd .. 46 | >> catkin_make 47 | Do not hesitate to recompile twice because of the bad dependances recognition in the compilation. 48 | 49 | --------------------------------------- 50 | Launch the Plugin !! 51 | 52 | Open the file "5.Launch ArduPilot_Gazebo.txt" and follow the instructions. 53 | 54 | -------------------------------------------------------------------------------- /scripts/step_1_configure_ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------- 3 | # Purpose: 4 | # Installs dependencies required by the Ardupilot's SITL. 5 | #---------------------------------------------------------- 6 | # Acknowledgements / References: 7 | # This script comes largely from the file initvagrant.sh 8 | # located on ardupilot/Tools/vagrant. 9 | #---------------------------------------------------------- 10 | 11 | 12 | # Stops at the first error it encounters 13 | set -e 14 | 15 | echo "Initial setup of Ubuntu" 16 | 17 | CWD=$(pwd) 18 | OPT="/opt" 19 | 20 | BASE_PKGS="gawk make git arduino-core curl" 21 | SITL_PKGS="g++ python-pip python-matplotlib python-serial python-wxgtk2.8 python-scipy python-opencv python-numpy python-pyparsing ccache realpath" 22 | PYTHON_PKGS="pymavlink MAVProxy droneapi catkin_pkg" 23 | PX4_PKGS="python-serial python-argparse openocd flex bison libncurses5-dev \ 24 | autoconf texinfo build-essential libftdi-dev libtool zlib1g-dev \ 25 | zip genromfs python-empy" 26 | BEBOP_PKGS="g++-arm-linux-gnueabihf" 27 | UBUNTU64_PKGS="libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386" 28 | ASSUME_YES=false 29 | 30 | # GNU Tools for ARM Embedded Processors 31 | # (see https://launchpad.net/gcc-arm-embedded/) 32 | ARM_ROOT="gcc-arm-none-eabi-4_9-2015q3" 33 | ARM_TARBALL="$ARM_ROOT-20150921-linux.tar.bz2" 34 | ARM_TARBALL_URL="http://firmware.diydrones.com/Tools/PX4-tools/$ARM_TARBALL" 35 | 36 | # Ardupilot Tools 37 | ARDUPILOT_TOOLS="ardupilot/Tools/autotest" 38 | 39 | function maybe_prompt_user() { 40 | if $ASSUME_YES; then 41 | return 0 42 | else 43 | read -p "$1" 44 | if [[ $REPLY =~ ^[Yy]$ ]]; then 45 | return 0 46 | else 47 | return 1 48 | fi 49 | fi 50 | } 51 | 52 | 53 | OPTIND=1 # Reset in case getopts has been used previously in the shell. 54 | while getopts "y" opt; do 55 | case "$opt" in 56 | \?) 57 | exit 1 58 | ;; 59 | y) ASSUME_YES=true 60 | ;; 61 | esac 62 | done 63 | 64 | if $ASSUME_YES; then 65 | APT_GET="sudo apt-get -qq --assume-yes" 66 | else 67 | APT_GET="sudo apt-get" 68 | fi 69 | 70 | sudo usermod -a -G dialout $USER 71 | 72 | $APT_GET remove modemmanager 73 | $APT_GET update 74 | $APT_GET install $BASE_PKGS $SITL_PKGS $PX4_PKGS $BEBOP_PKGS $UBUNTU64_PKGS 75 | sudo pip2 -q install $PYTHON_PKGS 76 | 77 | if [ ! -d $OPT/$ARM_ROOT ]; then 78 | ( 79 | cd $OPT; 80 | sudo wget $ARM_TARBALL_URL; 81 | sudo tar xjf ${ARM_TARBALL}; 82 | sudo rm ${ARM_TARBALL}; 83 | ) 84 | fi 85 | 86 | exportline="export PATH=$OPT/$ARM_ROOT/bin:\$PATH"; 87 | if ! grep -Fxq "$exportline" ~/.profile ; then 88 | if maybe_prompt_user "Add $OPT/$ARM_ROOT/bin to your PATH [Y/n]?" ; then 89 | echo $exportline >> ~/.profile 90 | $exportline 91 | else 92 | echo "Skipping adding $OPT/$ARM_ROOT/bin to PATH." 93 | fi 94 | fi 95 | 96 | -------------------------------------------------------------------------------- /Personal notes/step_scripts/step_1_configure_ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------- 3 | # Purpose: 4 | # Installs dependencies required by the Ardupilot's SITL. 5 | #---------------------------------------------------------- 6 | # Acknowledgements / References: 7 | # This script comes largely from the file initvagrant.sh 8 | # located on ardupilot/Tools/vagrant. 9 | #---------------------------------------------------------- 10 | 11 | 12 | # Stops at the first error it encounters 13 | set -e 14 | 15 | echo "Initial setup of Ubuntu" 16 | 17 | CWD=$(pwd) 18 | OPT="/opt" 19 | 20 | BASE_PKGS="gawk make git arduino-core curl" 21 | SITL_PKGS="g++ python-pip python-matplotlib python-serial python-wxgtk2.8 python-scipy python-opencv python-numpy python-pyparsing ccache realpath" 22 | PYTHON_PKGS="pymavlink MAVProxy droneapi catkin_pkg" 23 | PX4_PKGS="python-serial python-argparse openocd flex bison libncurses5-dev \ 24 | autoconf texinfo build-essential libftdi-dev libtool zlib1g-dev \ 25 | zip genromfs python-empy" 26 | BEBOP_PKGS="g++-arm-linux-gnueabihf" 27 | UBUNTU64_PKGS="libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386" 28 | ASSUME_YES=false 29 | 30 | # GNU Tools for ARM Embedded Processors 31 | # (see https://launchpad.net/gcc-arm-embedded/) 32 | ARM_ROOT="gcc-arm-none-eabi-4_9-2015q3" 33 | ARM_TARBALL="$ARM_ROOT-20150921-linux.tar.bz2" 34 | ARM_TARBALL_URL="http://firmware.diydrones.com/Tools/PX4-tools/$ARM_TARBALL" 35 | 36 | # Ardupilot Tools 37 | ARDUPILOT_TOOLS="ardupilot/Tools/autotest" 38 | 39 | function maybe_prompt_user() { 40 | if $ASSUME_YES; then 41 | return 0 42 | else 43 | read -p "$1" 44 | if [[ $REPLY =~ ^[Yy]$ ]]; then 45 | return 0 46 | else 47 | return 1 48 | fi 49 | fi 50 | } 51 | 52 | 53 | OPTIND=1 # Reset in case getopts has been used previously in the shell. 54 | while getopts "y" opt; do 55 | case "$opt" in 56 | \?) 57 | exit 1 58 | ;; 59 | y) ASSUME_YES=true 60 | ;; 61 | esac 62 | done 63 | 64 | if $ASSUME_YES; then 65 | APT_GET="sudo apt-get -qq --assume-yes" 66 | else 67 | APT_GET="sudo apt-get" 68 | fi 69 | 70 | sudo usermod -a -G dialout $USER 71 | 72 | $APT_GET remove modemmanager 73 | $APT_GET update 74 | $APT_GET install $BASE_PKGS $SITL_PKGS $PX4_PKGS $BEBOP_PKGS $UBUNTU64_PKGS 75 | sudo pip2 -q install $PYTHON_PKGS 76 | 77 | if [ ! -d $OPT/$ARM_ROOT ]; then 78 | ( 79 | cd $OPT; 80 | sudo wget $ARM_TARBALL_URL; 81 | sudo tar xjf ${ARM_TARBALL}; 82 | sudo rm ${ARM_TARBALL}; 83 | ) 84 | fi 85 | 86 | exportline="export PATH=$OPT/$ARM_ROOT/bin:\$PATH"; 87 | if ! grep -Fxq "$exportline" ~/.profile ; then 88 | if maybe_prompt_user "Add $OPT/$ARM_ROOT/bin to your PATH [Y/n]?" ; then 89 | echo $exportline >> ~/.profile 90 | $exportline 91 | else 92 | echo "Skipping adding $OPT/$ARM_ROOT/bin to PATH." 93 | fi 94 | fi 95 | 96 | -------------------------------------------------------------------------------- /scripts/step_3_install_arducopter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------- 3 | # Purpose: 4 | # Downloads and installs the lastest Github version of Ardupilot 5 | # and JSBSim simulator, placing them in the directory: 6 | # /home//shared_sitl 7 | #---------------------------------------------------------- 8 | # Acknowledgements / References: 9 | # Commands inspired from: 10 | # http://dev.ardupilot.com/wiki/using-rosgazebo-simulator-with-sitl/ 11 | #---------------------------------------------------------- 12 | 13 | 14 | # Stops at the first error it encounters 15 | #set -e 16 | 17 | #---------------------------------------------------------- 18 | # Feel free to modify the destination path for the ROS workspace: 19 | PROJECT_DIR=~/shared_sitl 20 | # If you are not using an emulated Linux (VMware), you may prefer a project path 21 | # like this one: 22 | #PROJECT_DIR=~/autopilot/sitl 23 | 24 | mkdir -p $PROJECT_DIR 25 | 26 | ##--------------------------------------------------------- 27 | ## Downloads ARDUPILOT 28 | 29 | echo "Getting latest version of Ardupilot..." 30 | cd $PROJECT_DIR 31 | #git clone git://github.com/diydrones/ardupilot.git 32 | # For the moment, use Alex Buyval's RangeFinderSITL2 branch 33 | git clone https://github.com/alexbuyval/ardupilot 34 | cd ardupilot 35 | git checkout RangeFinderSITL2 36 | # Saves the path on a variable 37 | export APM_ROOT=$PROJECT_DIR/ardupilot 38 | 39 | # Appends the path to Ardupilot to the PATH variable in the .profile script 40 | exportline="export PATH=$APM_ROOT/Tools/autotest:\$PATH" 41 | # Only appends it if not already present... 42 | if grep -Fxq "$exportline" ~/.profile 43 | then 44 | echo nothing to do 45 | else 46 | echo $exportline >> ~/.profile 47 | echo "JSBSim directory added to PATH in .profile" 48 | fi 49 | 50 | 51 | ##--------------------------------------------------------- 52 | ## Downloads & Builds JSBSIM 53 | 54 | echo "Getting latest version of JSBSim..." 55 | cd $PROJECT_DIR 56 | # Removes any existing jsbsim folder 57 | rm -rf jsbsim 58 | git clone git://github.com/tridge/jsbsim.git 59 | # Additional dependencies required 60 | sudo apt-get install libtool automake autoconf libexpat1-dev 61 | cd jsbsim 62 | git pull 63 | ./autogen.sh --enable-libraries 64 | make -j2 65 | sudo make install 66 | # Saves the path on a variable 67 | export JSBSIM_ROOT=$PROJECT_DIR/jsbsim 68 | 69 | # Appends the path to JSBSim to the PATH variable in the .profile script 70 | exportline="export PATH=$JSBSIM_ROOT/src:\$PATH" 71 | # Only appends it if not already present... 72 | if grep -Fxq "$exportline" ~/.profile 73 | then 74 | echo nothing to do 75 | else 76 | echo $exportline >> ~/.profile 77 | echo "JSBSim directory added to PATH in .profile" 78 | fi 79 | 80 | ##--------------------------------------------------------- 81 | 82 | # Execute .profile to update the changes to PATH 83 | sudo . ~/.profile 84 | 85 | cd $PROJECT_DIR 86 | 87 | echo "Ardupilot environment ready." 88 | echo "You can now launch the ROS installation script, for a Gazebo simulation." 89 | echo "Or you can directly run 'sim_vehicle.sh' to start a regular simulation." 90 | -------------------------------------------------------------------------------- /Personal notes/step_scripts/step_3_install_arducopter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------- 3 | # Purpose: 4 | # Downloads and installs the lastest Github version of Ardupilot 5 | # and JSBSim simulator, placing them in the directory: 6 | # /home//shared_sitl 7 | #---------------------------------------------------------- 8 | # Acknowledgements / References: 9 | # Commands inspired from: 10 | # http://dev.ardupilot.com/wiki/using-rosgazebo-simulator-with-sitl/ 11 | #---------------------------------------------------------- 12 | 13 | 14 | # Stops at the first error it encounters 15 | #set -e 16 | 17 | #---------------------------------------------------------- 18 | # Feel free to modify the destination path for the ROS workspace: 19 | PROJECT_DIR=~/shared_sitl 20 | # If you are not using an emulated Linux (VMware), you may prefer a project path 21 | # like this one: 22 | #PROJECT_DIR=~/autopilot/sitl 23 | 24 | mkdir -p $PROJECT_DIR 25 | 26 | ##--------------------------------------------------------- 27 | ## Downloads ARDUPILOT 28 | 29 | echo "Getting latest version of Ardupilot..." 30 | cd $PROJECT_DIR 31 | #git clone git://github.com/diydrones/ardupilot.git 32 | # For the moment, use Alex Buyval's RangeFinderSITL2 branch 33 | git clone https://github.com/alexbuyval/ardupilot 34 | cd ardupilot 35 | git checkout RangeFinderSITL2 36 | # Saves the path on a variable 37 | export APM_ROOT=$PROJECT_DIR/ardupilot 38 | 39 | # Appends the path to Ardupilot to the PATH variable in the .profile script 40 | exportline="export PATH=$APM_ROOT/Tools/autotest:\$PATH" 41 | # Only appends it if not already present... 42 | if grep -Fxq "$exportline" ~/.profile 43 | then 44 | echo nothing to do 45 | else 46 | echo $exportline >> ~/.profile 47 | echo "JSBSim directory added to PATH in .profile" 48 | fi 49 | 50 | 51 | ##--------------------------------------------------------- 52 | ## Downloads & Builds JSBSIM 53 | 54 | echo "Getting latest version of JSBSim..." 55 | cd $PROJECT_DIR 56 | # Removes any existing jsbsim folder 57 | rm -rf jsbsim 58 | git clone git://github.com/tridge/jsbsim.git 59 | # Additional dependencies required 60 | sudo apt-get install libtool automake autoconf libexpat1-dev 61 | cd jsbsim 62 | git pull 63 | ./autogen.sh --enable-libraries 64 | make -j2 65 | sudo make install 66 | # Saves the path on a variable 67 | export JSBSIM_ROOT=$PROJECT_DIR/jsbsim 68 | 69 | # Appends the path to JSBSim to the PATH variable in the .profile script 70 | exportline="export PATH=$JSBSIM_ROOT/src:\$PATH" 71 | # Only appends it if not already present... 72 | if grep -Fxq "$exportline" ~/.profile 73 | then 74 | echo nothing to do 75 | else 76 | echo $exportline >> ~/.profile 77 | echo "JSBSim directory added to PATH in .profile" 78 | fi 79 | 80 | ##--------------------------------------------------------- 81 | 82 | # Execute .profile to update the changes to PATH 83 | sudo . ~/.profile 84 | 85 | cd $PROJECT_DIR 86 | 87 | echo "Ardupilot environment ready." 88 | echo "You can now launch the ROS installation script, for a Gazebo simulation." 89 | echo "Or you can directly run 'sim_vehicle.sh' to start a regular simulation." 90 | -------------------------------------------------------------------------------- /scripts/step_5_create_ros_workspace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------- 3 | # Purpose: 4 | # Creates a ROS workspace and fetch source repositories, 5 | # placing them in the directory: 6 | # /home//ros/catkin_ws 7 | #---------------------------------------------------------- 8 | # Acknowledgements / References: 9 | # This script comes largely from: 10 | # https://pixhawk.org/dev/ros/sitl 11 | #---------------------------------------------------------- 12 | 13 | 14 | # Stops at the first error it encounters 15 | #set -e 16 | 17 | #----------------------------------------------- 18 | # Feel free to modify the destination path for the ROS workspace: 19 | WORKSPACE=~/ros/catkin_ws 20 | 21 | # Or if you prefer to create the workspace from the location of the 22 | # script, you can uncomment the following lines: 23 | # WDIR=`pwd` 24 | # WORKSPACE=$WDIR/catkin_ws 25 | #----------------------------------------------- 26 | 27 | source ~/.bashrc 28 | 29 | # Setup workspace 30 | mkdir -p $WORKSPACE/src 31 | cd $WORKSPACE/src 32 | catkin_init_workspace 33 | cd $WORKSPACE 34 | catkin_make 35 | sh -c "echo 'source $WORKSPACE/devel/setup.bash' >> ~/.bashrc" 36 | 37 | # Fetch sources 38 | ## Arducopter ROS configuration 39 | cd $WORKSPACE/src 40 | git clone https://alexbuyval@bitbucket.org/alexbuyval/arducopter_sitl_ros.git 41 | 42 | ## rotors simulator 43 | cd $WORKSPACE/src 44 | #git clone https://github.com/PX4/rotors_simulator.git 45 | git clone https://github.com/alexbuyval/rotors_simulator.git 46 | cd rotors_simulator 47 | git checkout sonar_plugin 48 | 49 | ## mav comm 50 | cd $WORKSPACE/src 51 | git clone https://github.com/PX4/mav_comm.git 52 | 53 | ## glog catkin 54 | cd $WORKSPACE/src 55 | git clone https://github.com/ethz-asl/glog_catkin.git 56 | 57 | ## catkin simple 58 | cd $WORKSPACE/src 59 | git clone https://github.com/catkin/catkin_simple.git 60 | 61 | ## Mavros 62 | cd $WORKSPACE 63 | # Installation of source code: 64 | wstool init src # (if not already initialized) 65 | wstool set -t src mavros --git https://github.com/alexbuyval/mavros.git 66 | wstool update -t src 67 | # Instead of getting raw source code for Mavros, it is possible 68 | # to download precompiled binaries with this command: 69 | # sudo apt-get install ros-indigo-mavros ros-indigo-mavros-extras 70 | 71 | # Checks any missing dependency 72 | echo "Checking for missing dependencies:" 73 | rosdep install --from-paths src --ignore-src --rosdistro indigo -y 74 | # It may throw an error of missing dependency on [gflags_catkin] for 75 | # package "glog_catkin", but this error does not seem to disrupt the 76 | # compilation (catkin_make). 77 | 78 | # Disable parallel make jobs for compilation. 79 | # Sometimes required inside Docker container or VMs with not enough memory. 80 | # If you're on a native Ubuntu installation, you can leave this away. 81 | export ROS_PARALLEL_JOBS= 82 | 83 | # Compile workspace 84 | cd $WORKSPACE 85 | source devel/setup.bash 86 | catkin_make 87 | # or use "catkin build" ? 88 | 89 | # If you wish to check that the workspace is properly setup, run the 90 | # following command to be sure it contains the path to the "src" folder 91 | # of your workspace. 92 | # echo $ROS_PACKAGE_PATH 93 | 94 | 95 | -------------------------------------------------------------------------------- /Personal notes/step_scripts/step_5_create_ros_workspace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------- 3 | # Purpose: 4 | # Creates a ROS workspace and fetch source repositories, 5 | # placing them in the directory: 6 | # /home//ros/catkin_ws 7 | #---------------------------------------------------------- 8 | # Acknowledgements / References: 9 | # This script comes largely from: 10 | # https://pixhawk.org/dev/ros/sitl 11 | #---------------------------------------------------------- 12 | 13 | 14 | # Stops at the first error it encounters 15 | #set -e 16 | 17 | #----------------------------------------------- 18 | # Feel free to modify the destination path for the ROS workspace: 19 | WORKSPACE=~/ros/catkin_ws 20 | 21 | # Or if you prefer to create the workspace from the location of the 22 | # script, you can uncomment the following lines: 23 | # WDIR=`pwd` 24 | # WORKSPACE=$WDIR/catkin_ws 25 | #----------------------------------------------- 26 | 27 | source ~/.bashrc 28 | 29 | # Setup workspace 30 | mkdir -p $WORKSPACE/src 31 | cd $WORKSPACE/src 32 | catkin_init_workspace 33 | cd $WORKSPACE 34 | catkin_make 35 | sh -c "echo 'source $WORKSPACE/devel/setup.bash' >> ~/.bashrc" 36 | 37 | # Fetch sources 38 | ## Arducopter ROS configuration 39 | cd $WORKSPACE/src 40 | git clone https://alexbuyval@bitbucket.org/alexbuyval/arducopter_sitl_ros.git 41 | 42 | ## rotors simulator 43 | cd $WORKSPACE/src 44 | #git clone https://github.com/PX4/rotors_simulator.git 45 | git clone https://github.com/alexbuyval/rotors_simulator.git 46 | cd rotors_simulator 47 | git checkout sonar_plugin 48 | 49 | ## mav comm 50 | cd $WORKSPACE/src 51 | git clone https://github.com/PX4/mav_comm.git 52 | 53 | ## glog catkin 54 | cd $WORKSPACE/src 55 | git clone https://github.com/ethz-asl/glog_catkin.git 56 | 57 | ## catkin simple 58 | cd $WORKSPACE/src 59 | git clone https://github.com/catkin/catkin_simple.git 60 | 61 | ## Mavros 62 | cd $WORKSPACE 63 | # Installation of source code: 64 | wstool init src # (if not already initialized) 65 | wstool set -t src mavros --git https://github.com/alexbuyval/mavros.git 66 | wstool update -t src 67 | # Instead of getting raw source code for Mavros, it is possible 68 | # to download precompiled binaries with this command: 69 | # sudo apt-get install ros-indigo-mavros ros-indigo-mavros-extras 70 | 71 | # Checks any missing dependency 72 | echo "Checking for missing dependencies:" 73 | rosdep install --from-paths src --ignore-src --rosdistro indigo -y 74 | # It may throw an error of missing dependency on [gflags_catkin] for 75 | # package "glog_catkin", but this error does not seem to disrupt the 76 | # compilation (catkin_make). 77 | 78 | # Disable parallel make jobs for compilation. 79 | # Sometimes required inside Docker container or VMs with not enough memory. 80 | # If you're on a native Ubuntu installation, you can leave this away. 81 | export ROS_PARALLEL_JOBS= 82 | 83 | # Compile workspace 84 | cd $WORKSPACE 85 | source devel/setup.bash 86 | catkin_make 87 | # or use "catkin build" ? 88 | 89 | # If you wish to check that the workspace is properly setup, run the 90 | # following command to be sure it contains the path to the "src" folder 91 | # of your workspace. 92 | # echo $ROS_PACKAGE_PATH 93 | 94 | 95 | -------------------------------------------------------------------------------- /scripts/step_4_install_ros.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------- 3 | # Purpose: 4 | # Installs ROS (Robot Operating System), and a few addional 5 | # dependencies / compiled packages required for the Ardupilot 6 | # simulation. 7 | #---------------------------------------------------------- 8 | # Acknowledgements / References: 9 | # This script comes largely from: 10 | # https://pixhawk.org/dev/ros/sitl 11 | # With some commands inspired from: 12 | # http://wiki.ros.org/indigo/Installation/Ubuntu 13 | # http://gazebosim.org/tutorials?tut=drcsim_install 14 | # http://dev.ardupilot.com/wiki/using-rosgazebo-simulator-with-sitl/ 15 | #---------------------------------------------------------- 16 | 17 | # Note: 18 | # Sometimes, if the system was not perfectly clean before, the installation 19 | # fails because of mesa packages interlocks. 20 | # In such case, you can try to install them manually by typing in a terminal: 21 | # 22 | # sudo apt-get install xserver-xorg-dev-lts-utopic mesa-common-dev-lts-utopic libgles2-mesa-dev-lts-utopic libgles1-mesa-dev-lts-utopic libgl1-mesa-dev-lts-utopic libegl1-mesa-dev-lts-utopi 23 | # 24 | # and then re-run this script. (Good luck, this problem is a real pain !) 25 | # Solution seen on: 26 | # http://askubuntu.com/questions/588695/cant-install-libglew-dev-because-libcheese-and-libclutter-dont-have-the-requir 27 | 28 | 29 | # Stops at the first error it encounters 30 | set -e 31 | 32 | export DEBIAN_FRONTEND=noninteractive 33 | 34 | 35 | 36 | ## add ROS repository and key 37 | ## install main ROS pacakges 38 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' 39 | sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 0xB01FA116 40 | #wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add - 41 | sudo apt-get update 42 | 43 | # In case there was a missing dependency, you may try the following line. 44 | # However, be careful not to attempt to desinstall-reinstall libgl1-mesa, 45 | # for it sometimes messes up the ubuntu installation. 46 | # sudo apt-get -y install libgl1-mesa-dev-lts-utopic 47 | 48 | sudo apt-get -y install ros-indigo-desktop-full 49 | 50 | sudo rosdep init 51 | rosdep update 52 | 53 | ## setup environment variables 54 | sudo sh -c 'echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc' 55 | source ~/.bashrc 56 | 57 | ## get rosinstall and some additional dependencies 58 | sudo apt-get -y install python-rosinstall \ 59 | ros-indigo-octomap-msgs \ 60 | ros-indigo-joy \ 61 | ros-indigo-geodesy \ 62 | ros-indigo-octomap-ros \ 63 | unzip 64 | 65 | 66 | ## add osrf repository 67 | ## install drcsim 68 | sudo sh -c 'echo "deb http://packages.osrfoundation.org/drc/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/drc-latest.list' 69 | wget http://packages.osrfoundation.org/drc.key -O - | sudo apt-key add - 70 | sudo apt-get update 71 | sudo apt-get -y install drcsim 72 | 73 | ## install mavros but from shadow repo to get latest version earlier 74 | sudo sh -c 'echo "deb http://packages.ros.org/ros-shadow-fixed/ubuntu/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-shadow.list' 75 | sudo apt-get update 76 | sudo apt-get -y install ros-indigo-mavros \ 77 | ros-indigo-mavros-extras 78 | 79 | RED='\033[0;32m' 80 | NC='\033[0m' # No Color 81 | printf "${RED}ROS is now installed \n${NC}" 82 | printf "${RED}You should close this terminal and open a new one before launching the step_5 script\n${NC}" 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /Personal notes/step_scripts/step_4_install_ros.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------- 3 | # Purpose: 4 | # Installs ROS (Robot Operating System), and a few addional 5 | # dependencies / compiled packages required for the Ardupilot 6 | # simulation. 7 | #---------------------------------------------------------- 8 | # Acknowledgements / References: 9 | # This script comes largely from: 10 | # https://pixhawk.org/dev/ros/sitl 11 | # With some commands inspired from: 12 | # http://wiki.ros.org/indigo/Installation/Ubuntu 13 | # http://gazebosim.org/tutorials?tut=drcsim_install 14 | # http://dev.ardupilot.com/wiki/using-rosgazebo-simulator-with-sitl/ 15 | #---------------------------------------------------------- 16 | 17 | # Note: 18 | # Sometimes, if the system was not perfectly clean before, the installation 19 | # fails because of mesa packages interlocks. 20 | # In such case, you can try to install them manually by typing in a terminal: 21 | # 22 | # sudo apt-get install xserver-xorg-dev-lts-utopic mesa-common-dev-lts-utopic libgles2-mesa-dev-lts-utopic libgles1-mesa-dev-lts-utopic libgl1-mesa-dev-lts-utopic libegl1-mesa-dev-lts-utopi 23 | # 24 | # and then re-run this script. (Good luck, this problem is a real pain !) 25 | # Solution seen on: 26 | # http://askubuntu.com/questions/588695/cant-install-libglew-dev-because-libcheese-and-libclutter-dont-have-the-requir 27 | 28 | 29 | # Stops at the first error it encounters 30 | set -e 31 | 32 | export DEBIAN_FRONTEND=noninteractive 33 | 34 | 35 | 36 | ## add ROS repository and key 37 | ## install main ROS pacakges 38 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' 39 | sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 0xB01FA116 40 | #wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add - 41 | sudo apt-get update 42 | 43 | # In case there was a missing dependency, you may try the following line. 44 | # However, be careful not to attempt to desinstall-reinstall libgl1-mesa, 45 | # for it sometimes messes up the ubuntu installation. 46 | # sudo apt-get -y install libgl1-mesa-dev-lts-utopic 47 | 48 | sudo apt-get -y install ros-indigo-desktop-full 49 | 50 | sudo rosdep init 51 | rosdep update 52 | 53 | ## setup environment variables 54 | sudo sh -c 'echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc' 55 | source ~/.bashrc 56 | 57 | ## get rosinstall and some additional dependencies 58 | sudo apt-get -y install python-rosinstall \ 59 | ros-indigo-octomap-msgs \ 60 | ros-indigo-joy \ 61 | ros-indigo-geodesy \ 62 | ros-indigo-octomap-ros \ 63 | unzip 64 | 65 | 66 | ## add osrf repository 67 | ## install drcsim 68 | sudo sh -c 'echo "deb http://packages.osrfoundation.org/drc/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/drc-latest.list' 69 | wget http://packages.osrfoundation.org/drc.key -O - | sudo apt-key add - 70 | sudo apt-get update 71 | sudo apt-get -y install drcsim 72 | 73 | ## install mavros but from shadow repo to get latest version earlier 74 | sudo sh -c 'echo "deb http://packages.ros.org/ros-shadow-fixed/ubuntu/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-shadow.list' 75 | sudo apt-get update 76 | sudo apt-get -y install ros-indigo-mavros \ 77 | ros-indigo-mavros-extras 78 | 79 | RED='\033[0;32m' 80 | NC='\033[0m' # No Color 81 | printf "${RED}ROS is now installed \n${NC}" 82 | printf "${RED}You should close this terminal and open a new one before launching the step_5 script\n${NC}" 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /Personal notes/5.Launch ArduPilot_Gazebo.txt: -------------------------------------------------------------------------------- 1 | __________________________________________________ 2 | Option A.1: Arducopter From Script (Our preffered method) 3 | 4 | 5 | Launch 'sim_vehicle.sh' with the option "-v ArduCopter -f Gazebo -r empty_world -L Annecy". 6 | 7 | cd ~/shared_sitl/ardupilot/Tools/autotest 8 | ./sim_vehicle.sh -v ArduCopter -f Gazebo -r empty_world -L Annecy --map --console 9 | 10 | It uses the current ArduCopter firmware. 11 | In this case Gazebo is launched from 'SIM_Gazebo.cpp', with a call to 12 | the 'start_ros_gazebo()' function. 13 | It will run "apm.launch" start file. 14 | 15 | With this method, you do not see ArduCopter's print outputs. 16 | __________________________________________________ 17 | Option A.2: ArduPlane From Script (Our preffered method) 18 | 19 | Same as Arducopter 20 | 21 | cd ~/shared_sitl/ardupilot/Tools/autotest 22 | ./sim_vehicle.sh -v ArduPlane -f Gazebo -r empty_world_cessna -L Annecy --map --console --out 192.168.1.30:14550 23 | 24 | Use --out 192.168.1.30:14550 when you connect another laptop to mavproxy. With ipconfig on this laptop you can see the IPV4 adress and connect throw Mission Planner or APM planner in UDP. 25 | 26 | __________________________________________________ 27 | Option B: From Eclipse, Gazebo started by Ardu 28 | 29 | Define the .elf launch arguments: 30 | -S -I0 --home 45.843136,6.1615122,16,180 --model Gazebo --speedup=1 --autotest-dir X --launch-world X 31 | 32 | 33 | Launch the ArduCopter source code 34 | Make sure that in 'SIM_Gazebo.cpp' the function call to 35 | 'start_ros_gazebo()' is not commented out (should be in the class constructor). 36 | It will run "apm.launch" start file. 37 | Eclipse run configuration: "SITL Gazebo" 38 | 39 | __________________________________________________ 40 | Option C: From Eclipse, and Gazebo from terminal 41 | 42 | 43 | Define the .elf launch arguments: 44 | -S -I0 --home 45.843136,6.1615122,16,180 --model Gazebo --speedup=1 --autotest-dir X --launch-world X 45 | 46 | In the file 'libraries/SITL/SIM_Gazebo.cpp', comment the line 47 | #define LAUNCH_ROS_FROM_ARDUPILOT 48 | 49 | In a terminal alongside, type in: (current directory does not matter) 50 | "roslaunch arducopter_sitl_gazebo_plugin apm.launch" 51 | 52 | roslaunch ardupilot_sitl_gazebo_plugin empty_world.launch 53 | 54 | First launch ArduCopter from Eclipse, wait for a few seconds, then run the ROS command 55 | in the terminal. For ArduCopter will wait for MAVROS, but MAVROS will not wait 56 | for ArduCopter (it exits immediately if nobody answers). 57 | 58 | Eclipse run configuration: "SITL Gazebo" 59 | 60 | 61 | cd ~/px4/MavProxy/MAVProxy/build/scripts-2.7 62 | mavproxy.py --master 127.0.0.1:14550 --out 127.0.0.1:14551 --cmd=" map overlay /home/aurelien/ros/catkin_ws/src/arducopter_sitl_gazebo_plugin/worlds/empty_world/map_w40m_h40m.png 45.8430554 6.1613957;" --map --console --aircraft aircraft_generic 63 | 64 | 65 | cd ~/px4/MavProxy/MAVProxy/build/scripts-2.7 66 | ./mavproxy.py --master 127.0.0.1:14550 --out 192.168.1.30:14551 --console --map --aircraft aircraft_generic 67 | 68 | OR 69 | ./mavproxy.py --master 127.0.0.1:14550 --out 192.168.1.30:14551 --console --map --aircraft aircraft_warehouse_full 70 | 71 | OR 72 | ./mavproxy.py --master 127.0.0.1:14550 --out 192.168.1.30:14551 --console --map --aircraft aircraft_outdoor 73 | 74 | __________________________________________________ 75 | Once Launched: 76 | 77 | In the first console Nautilus you will get mavproxy values. You can control the drone in this terminal with MavProxy console commands (for example module load map, module load console, rc 3 1500, module load graph, graph WIND.direction, graph timespan60,output add 192.168.1.31:14551) 78 | On the second console (Xterm) you will get gazebo launch datas 79 | 80 | On another terminal you can launch RVIZ which catch topic to show datas like camera footages 81 | : rviz, add, By topic /recorder_cam OK 82 | 83 | -------------------------------------------------------------------------------- /Personal notes/4.Setup Eclipse Linux.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Downlowd Eclipse 4 | https://eclipse.org/downloads/ 5 | Linux version, 64 bits C++ 6 | 7 | Move the script "install_eclipse.sh" to the folder where the eclipse(...).tar.gz 8 | is located. 9 | Run the script. 10 | 11 | 12 | # NO: 13 | # Uncompress it: 14 | # tar -xf eclipse(...).tar 15 | # Run it: 16 | # cd eclipse/ 17 | # ./eclipse 18 | 19 | Create a workspace anywhere 20 | 21 | Import Project / C/C++ / Existing Code as Makefile Project 22 | Select the ArduCopter directory (not ardupilot) 23 | 24 | Select the Cross ... compiler (exact ?) 25 | 26 | 0. GENERAL PROPERTIES 27 | In the menu bar Window / Preferences, got to category 28 | Geberal / Workspace 29 | And activate the checkbox "Save automatically before build" 30 | 31 | Project Properties (right click menu): 32 | 33 | 1. BUILDER PATH 34 | In left menu tab "C/C++ Build", 35 | In window tab "Builder Settings": 36 | For Build location, replace the directory with "${ProjDirPath}" 37 | 38 | 39 | 40 | 2. ARDUCOPTER LIBRARIES 41 | In left menu tab "C/C++ General", "Paths and Symbols", 42 | In window tab "Source Location": 43 | Click "Link Folder" 44 | In the pop-up window, activate "Link to folder in file system", then select the folder "libraries" in "ardupilot" (leave the full absolute path to the directory). 45 | 46 | (GCS_Mavlink is compiled with a C compiler, when using C++ preprocessors, it is badly parsed) 47 | so tried to filter out GCS_Mavlink, and add it on the side with __GNUC__ define) 48 | but did not work 49 | on ArduCopter/libraries, click "Edit filter", click "Add exlusion pattern": 50 | write "GCS_MAVLink/" 51 | 52 | 3. STANDARD HEADER FILES 53 | In left menu tab "C/C++ General", "Paths and Symbols", 54 | In window tab "Includes": 55 | for language "GNU C++", click "Add...", and enter the following directories (repeat the Add operation for each one): 56 | 57 | /opt/gcc-arm-none-eabi-4_7-2014q2/arm-none-eabi/include 58 | /opt/gcc-arm-none-eabi-4_7-2014q2/lib/gcc/arm-none-eabi/4.7.4/include/ 59 | 60 | (to replace with your current gcc-arm versions if different) 61 | 62 | This step solves the links to stdio.h, math.h, stdarg.h, ... 63 | 64 | 65 | 66 | 4. MANAGE CONFIGURATIONS (Pixhawk, SITL, ...) 67 | In left menu tab "C/C++ Build", 68 | In window, click the top right button "Manage Configurations..." 69 | Rename the default configuration: 70 | Name: Pixhawk 71 | Description: Arm compiler and upload to pixhawk board 72 | 73 | Add a new configuration: 74 | Name: SITL 75 | Description: For the simulation 76 | With the copy parameters from the Pixhawk config 77 | 78 | 79 | 5. PROJECT PREPROCESSOR DEFINITIONS 80 | In left menu tab "C/C++ General", "Paths and Symbols", 81 | In window tab "Symbols": 82 | 83 | For the PIXHAWK configuration: 84 | 85 | for language "GNU C++", click "Add...", and enter the following name = value pairs (repeat the Add operation for each one): 86 | 87 | FRAME_CONFIG = QUAD_FRAME 88 | CONFIG_HAL_BOARD = HAL_BOARD_PX4 89 | HIL_MODE = HIL_MODE_DISABLED 90 | 91 | 92 | For the SITL configuration: 93 | Same thing with values: 94 | 95 | FRAME_CONFIG = QUAD_FRAME 96 | CONFIG_HAL_BOARD = HAL_BOARD_SITL 97 | HIL_MODE = HIL_MODE_DISABLED 98 | 99 | 100 | 101 | 102 | Clic droit projet Properties 103 | Resources / Linked Resources 104 | tab Linked Resources 105 | en cas de chemin absolu, remplacer par des chemins relatifs, comme: 106 | ${PROJECT_LOC}/../libraries 107 | 108 | 109 | 110 | Pour definir le lancement: 111 | clic droit projet / Run As... / Run Configurations 112 | 113 | Dans C/C++ Application, faire New 114 | dans le champ "C/C++ Application:" taper "ArduCopter.elf" 115 | dans l'onglet Arguments, dans le champ taper : 116 | -S -I0 --home 44.1538314,4.8018222,50,15 --model + --speedup=1 117 | 118 | Ou "../../ArduCopter/ArduCopter.elf" ? 119 | 120 | Dans "Build configuration", indiquer "SITL" au lieu de "Use Active". 121 | 122 | 123 | Menu Run / External Tools / External Tools Configuration 124 | En ajouter une nouvelle : 125 | nom = MavProxy 126 | ${project_loc:/ArduCopter}/run_mavproxy.sh 127 | ${project_loc:/ArduCopter}/../Tools/autotest/run_mavproxy.sh 128 | 129 | (en ayant auparavant fait un chmod +x sur le shell) 130 | dans l'onglet Build, decocher "Build before launch" 131 | 132 | 133 | Ajouter une nouvelle : 134 | nom = Gazebo 135 | ${project_loc:/ArduCopter}/../Tools/autotest/run_gazebo.sh 136 | 137 | 138 | 139 | 140 | Follow some rules from: 141 | http://dev.ardupilot.com/wiki/editing-the-code-with-eclipse/ 142 | 143 | 144 | Dans le futur, pour aller plus loin: 145 | http://www.2net.co.uk/tutorial/eclipse-rse 146 | 147 | 148 | 149 | https://pixhawk.org/dev/jtag/gdb_eclipse 150 | 151 | Suivre: 152 | http://janaxelson.com/eclipse2.htm 153 | Pour l'install des plugins C++ ? 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /Personal notes/0.FR_softs_utiles.txt: -------------------------------------------------------------------------------- 1 | 2 | _____________________________________________________ 3 | Install Ubuntu en dual boot: 4 | http://doc.ubuntu-fr.org/cohabitation_ubuntu_windows 5 | http://doc.ubuntu-fr.org/windows 6 | 7 | 8 | _____________________________________________________ 9 | Ajouter le raccourci vers le terminal sur la barre de lancement rapide. 10 | Voir pour cela le tutoriel sur la mise en place de l'emulation Linux (le github). 11 | 12 | _____________________________________________________ 13 | Mise a jour Ubuntu 14 | sudo apt-get update 15 | 16 | _____________________________________________________ 17 | Multiple workspace 18 | Les activer dans Appearance/onglet behavior/Enable workspaces 19 | https://launchpad.net/ubuntu/+source/compizconfig-settings-manager 20 | 21 | Pour deplacer une fenetre: 22 | Ctrl + Alt + Shift + fleches 23 | Ou clic droit sur barre titre "Move to worksapce ..." 24 | 25 | 26 | _____________________________________________________ 27 | Installer notepadqq (= Notepad++) 28 | http://sourcedigit.com/13031-install-notepadqq-notepad-text-editor-ubuntu-14-04-linux-mint-17/ 29 | (and install qt on path "~/Qt", or with simlink) 30 | for QT: 31 | from http://download.qt.io/official_releases/qt/5.5/5.5.0/ 32 | choose the linux version, x64 or x86 33 | then follow 34 | https://wiki.qt.io/Install_Qt_5_on_Ubuntu 35 | Et choisir comme dossier d'installation ~/Qt !!! sinon ca ne marche pas (ou essayer l'autre proposition en /opt/... indiqué par notepadqq lorsqu'il ne trouve pas Qt) 36 | 37 | Dans notepadqq: 38 | Aller dans Settings/Preferences/Languages 39 | Activer "Use spaces instead of tabs" 40 | 41 | 42 | _____________________________________________________ 43 | Update LibreOffice: 44 | http://askubuntu.com/questions/505368/how-do-i-update-libreoffice-to-next-point-release-in-14-04/505389#505389 45 | 46 | 47 | _____________________________________________________ 48 | vlc 49 | 50 | sudo apt-get update 51 | sudo apt-get install vlc browser-plugin-vlc 52 | 53 | Puis pour le definir comme programme par defaut pour les fichiers video, 54 | sur un fichier video, faire : right click, Properties, tab Open With, 55 | select VLC "Set as Default" 56 | 57 | 58 | 59 | _____________________________________________________ 60 | APM Planner 2 61 | MissionPlanner n'existe pas pour Linux. 62 | http://planner2.ardupilot.com/wiki/installation-for-linux/ 63 | 64 | 65 | _____________________________________________________ 66 | Programme de dessin (= Paint.net) : Pinta 67 | http://pinta-project.com/howto/installing-pinta 68 | 69 | - Click on Ubuntu Software Center from Launcher (left site icon panel). 70 | - At the top right input box type in: Pinta and press Enter. 71 | - Pinta is displayed in list bellow. Click on it and click the Install button. 72 | 73 | 74 | _____________________________________________________ 75 | Client Git : installer SmartGit 76 | 77 | https://help.github.com/articles/set-up-git/ 78 | 79 | SmartGit 80 | http://www.syntevo.com/smartgit/download 81 | Chapitre 3 de : 82 | https://www.maketecheasier.com/6-useful-graphical-git-client-for-linux/ 83 | Pour installer java, suivre: 84 | https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get 85 | 86 | Par contre SmartGit est gratuit uniquement en usage non commercial. (Il faudra en changer ensuite) 87 | 88 | 89 | _____________________________________________________ 90 | Client SVN : installer RabbitVCS 91 | 92 | L'equivalent est RabbitVCS 93 | http://wiki.rabbitvcs.org/ 94 | 95 | To install it: 96 | 97 | sudo add-apt-repository ppa:rabbitvcs/ppa 98 | sudo apt-get update 99 | sudo apt-get install rabbitvcs-cli 100 | sudo apt-get install rabbitvcs-gedit 101 | sudo apt-get install rabbitvcs-thunar 102 | sudo apt-get install rabbitvcs-nautilus3 103 | 104 | "rabbitvcs-nautilus3" est prevu pour Nautilus 3.x (explorateur de fichiers). 105 | Pour Nautilus 2.x, la commande est "rabbitvcs-nautilus". Utiliser la commande 106 | "nautilus --version" pour connaitre votre version. 107 | 108 | 109 | _____________________________________________________ 110 | Installer FlightGear 111 | http://doc.ubuntu-fr.org/flightgear 112 | 113 | 114 | _____________________________________________________ 115 | Installer Eclipse 116 | 117 | Suivre les instructions de : 118 | "Setup Eclipse Linux.txt", et utiliser le script "install_eclipse.sh". 119 | 120 | 121 | _____________________________________________________ 122 | Touches accents sur clavier Qwerty 123 | 124 | https://userbase.kde.org/ComposeKey#Introduction 125 | https://help.ubuntu.com/community/GtkComposeTable 126 | 127 | Aller dans System Settings / Text Entry 128 | Cliquer sur Keyboard Setting en bas a droite 129 | Dans Shortcuts / Typing, activer "Compose Key" 130 | 131 | é 132 | 133 | 134 | _____________________________________________________ 135 | To uninstall things: 136 | https://raphaelhertzog.com/2011/03/07/debian-cleanup-tip-6-remove-automatically-installed-packages/ 137 | http://askubuntu.com/questions/151941/how-can-you-completely-remove-a-package 138 | http://askubuntu.com/questions/1143/how-can-i-uninstall-software 139 | 140 | _____________________________________________________ 141 | To list all ppa: 142 | http://askubuntu.com/questions/148932/how-can-i-get-a-list-of-all-repositories-and-ppas-from-the-command-line 143 | To list packages: 144 | https://help.ubuntu.com/community/ListInstalledPackagesByDate 145 | 146 | _____________________________________________________ 147 | Taskbar customization: 148 | http://askubuntu.com/questions/536476/how-can-i-group-applications-in-one-launcher-icon 149 | http://askubuntu.com/questions/524576/adding-folder-shortcut-to-launcher-ubuntu-14-04 150 | 151 | 152 | 153 | 154 | 155 | --------------------------------------------------------------------------------