Ardusub Configuration

git clone https://github.com/ArduPilot/ardupilot.git 1
cd ardupilot
git submodule update --init --recursive
alias waf="$PWD/modules/waf/waf-light"
pip install future
waf configure --board=navio2
waf build sub
Hi,
I wrote these codes on terminal and uploads completed. But I dont know how can I connect Navio2 to Qgroundcontrol for Ardusub. As you know there are 3 options: ardurover, arducopter and arduplane. I mean when I write sudo emlidtool ardupilot i only see these options. How can I compile Ardusub?
I am waiting for your helps. And sorry for my English.

Hello,

First I’m not ardusub user (arducopter with Navio2) but the ground is common.

Ardusub usage is not integrated in EmlidTool. So I will guide you with some alteration to the Navio2 wiki. I will not use your compiled ardusub file but the latest stable…

Arduxxxx executables are stored in /opt/ardupilot/navio2

pi@navio:~ $ cd /opt/ardupilot/navio2

There are directories for common vehicles:

pi@navio:/opt/ardupilot/navio2 $ ls -l
total 16
drwxrwxr-x 3 root root 4096 Sep 22 2017 arducopter-3.5
drwxrwxr-x 3 root root 4096 Sep 22 2017 arduplane-3.8
drwxrwxr-x 3 root root 4096 Sep 22 2017 ardurover-3.2
drwxr-xr-x 3 root root 4096 Aug 25 07:04 ardurover-3.3

I will create a new one for ardusub

pi@navio:/opt/ardupilot/navio2 $ sudo mkdir ardusub

and verify it is OK:

pi@navio:/opt/ardupilot/navio2 $ ls -l
total 20
drwxrwxr-x 3 root root 4096 Sep 22 2017 arducopter-3.5
drwxrwxr-x 3 root root 4096 Sep 22 2017 arduplane-3.8
drwxrwxr-x 3 root root 4096 Sep 22 2017 ardurover-3.2
drwxr-xr-x 3 root root 4096 Aug 25 07:04 ardurover-3.3
drwxr-xr-x 2 root root 4096 Aug 25 07:22 ardusub

Then open the ardusub directory

pi@navio:/opt/ardupilot/navio2 $ cd ardusub

I will install the latest stable of ardusub from http://firmware.ardupilot.org/Sub/stable/navio2/

pi@navio:/opt/ardupilot/navio2/ardusub $ sudo wget http://firmware.ardupilot.org/Sub/stable/navio2/ardusub

–2018-08-25 07:25:52-- http://firmware.ardupilot.org/Sub/stable/navio2/ardusub
Resolving firmware.ardupilot.org (firmware.ardupilot.org)… 208.68.38.241
Connecting to firmware.ardupilot.org (firmware.ardupilot.org)|208.68.38.241|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 992220 (969K)
Saving to: ‘ardusub’

ardusub 100%[============================================================================================>] 968.96K 686KB/s in 1.4s

2018-08-25 07:25:53 (686 KB/s) - ‘ardusub’ saved [992220/992220]

and check the file is there, not yet usable, some chmod to do:

pi@navio:/opt/ardupilot/navio2/ardusub $ ls -l
total 972
-rw-r–r-- 1 root root 992220 May 8 18:52 ardusub

pi@navio:/opt/ardupilot/navio2/ardusub $ sudo chmod +x ardusub

Done…

Now there are some files to edit and actions to do…

First ardupilot service to instruct where to find the ardusub executable:

pi@navio:/opt/ardupilot/navio2/ardusub $ cd
pi@navio:~ $ sudo nano /etc/systemd/system/ardupilot.service

[Unit]
Description=ArduPilot for Linux
After=systemd-modules-load.service
Documentation=https://docs.emlid.com/navio2/navio-ardupilot/installation-and-running/#autostarting-ardupilot-on-boot
Conflicts=arduplane.service arducopter.service ardurover.service

[Service]
EnvironmentFile=/etc/default/ardupilot

###############################################################################
####### DO NOT EDIT ABOVE THIS LINE UNLESS YOU KNOW WHAT YOU"RE DOING #########
###############################################################################

#@ Uncomment and modify this line if you want to launch your own binary
ExecStart=/bin/sh -c "/opt/ardupilot/navio2/ardusub/ardusub ${ARDUPILOT_OPTS}"

CAUTION

##There should be only one uncommented ExecStart in this file

###############################################################################
######## DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU"RE DOING ########
###############################################################################

Restart=on-failure

[Install]
WantedBy=multi-user.target

Then we need to configure the communication parameters. Replace my PC IP by yours for UDP connection:

pi@navio:~ $ sudo nano /etc/default/ardupilot

#Default settings for ArduPilot for Linux.
#The file is sourced by systemd from ardupilot.service

TELEM1="-A udp:192.168.1.20:14550"
TELEM2="-C /dev/ttyAMA0"

#Options to pass to ArduPilot
ARDUPILOT_OPTS="$TELEM1 $TELEM2"

                      #    # ###### #      #####
                      #    # #      #      #    #
                      ###### #####  #      #    #
                      #    # #      #      #####
                      #    # #      #      #
                      #    # ###### ###### #

#-A is a console switch (usually this is a Wi-Fi link)

#-C is a telemetry switch
#Usually this is either /dev/ttyAMA0 - UART connector on your Navio
#or /dev/ttyUSB0 if you’re using a serial to USB convertor

#-B or -E is used to specify non default GPS

#Type “emlidtool ardupilot” for further help

Some more magic if arducopter is running by default:

pi@navio:~ $ sudo systemctl disable arducopter
Removed /etc/systemd/system/multi-user.target.wants/arducopter.service.

Then ask for ardusub to run at startup:

pi@navio:~ $ sudo systemctl start ardupilot && sudo systemctl enable ardupilot
Created symlink /etc/systemd/system/multi-user.target.wants/ardupilot.service → /etc/systemd/system/ardupilot.service.

pi@navio:~ $ sudo reboot

If Ardusub QgroundControl (https://www.ardusub.com/getting-started/installation.html#ardusub) is running on your PC, it should connect in UDP…

If you have some difficulties, ask for help,

Marc

2 Likes

Thanks for help. Ardusub is running now. :slight_smile:

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.