Configuration

The Autopilot is the system that allows to control the features of a vehicle like speed, altitude or trajectory. Also, allow to control the vehicle with different Dive Modes like stabilization or deep hold. For this project you will need a PXFmini with a Raspberry Pi 2 or 3 or a Erle-Brain 2.

Also the embed platform that you are using will need to have a valid operative system. Check the valid images for Erle-Brain 2 and PXFmini.

The next steps will Compile ArduSub repository for PXFmini and Raspberry Pi 2/3.

cd ~
git clone https://github.com/bluerobotics/ardusub
cd ardusub
cd ArduSub
make clean
make pxfmini-bluerov
# if errors run the next and try again
sudo ~/ardusub/Tools/scripts/install-prereqs-ubuntu.sh

The next steps will Compile ArduSub repository for an Erle-Brain 2

cd ~
git clone https://github.com/bluerobotics/ardusub
cd ardusub
cd ArduSub
make clean
make erlebrain2-bluerov
# if errors run the next and try again
sudo ~/ardusub/Tools/scripts/install-prereqs-ubuntu.sh

scp /tmp/ArduSub.build/ArduSub.elf erle@10.0.0.1:~/ArduSub.elf

In order to use the uploaded binary, the next file should be updated:

ssh erle@10.0.0.1

nano ~/apm.sh

The next line should be updated, set ArduSub.elf file:

#line 29
$APM_BIN_DIR/ArduSub2.elf # ...

Enable apm.service and start

sudo systemctl enable apm
sudo systemctl start apm

Now the ArduSub.elf binary will be automatically launched at boot. The autopilot should be working.

In order to stream video the next commands should be performed: Now it is necessary to connect the brain via Ethernet to Internet.

sudo apt-get install -y gstreamer1.0
sudo reboot

sudo raspivid -t 0 -h 720 -w 1080 -fps 25 -hf -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse !  rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=10.0.0.1 port=5600

# gstreamer should be also installed
gst-launch-1.0 -v tcpclientsrc host=10.0.0.1 port=5600 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! videoflip method=horizontal-flip  ! autovideosink sync=false

Under the water the radio communications are not possible. The data communication will be performed via Ethernet cable. The next file should be edited to gain a valid IP address at autopilot's eth0 interface:

nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 10.0.0.1
netmask 255.255.255.0

Remove any WiFi dongle and reboot.

sudo reboot

After booting, client computer should set manually the 10.0.0.2 IP address in order to connect using Ethernet cable.

In order to control the submarine a QGroundControl software will be used. Download links are available here.

To create a new link in QGroundControl click the logo > Comm Links > Add.


Set an UDP connection to the 6000 port.


After saving, select the new connection and click Connect.


Now the QGroundControl should be connected to the autopilot.

In order to configure the Joystick it is necessary that the link is established. If a 360 game pad and a Mac OS is used some drivers are required. We recommend 360Controller.

ArduSub provides a number of parameters to map controller buttons to various functions. This setup is required as there are no defaults configured. Check a recommended build here.

First, is necessary to calibrate the joystick in order to enable it.

NOTE: We want to calibrate the joysticks in the opposite way that QGC asks us to do it. When asked to move each axis, move the following sticks:

  • Throttle: right stick up/down
  • Yaw: right stick right/left
  • Roll: left stick right/left
  • Pitch: left stick up/down


Some fast configuration of the button mapping to allow arming and disarming via the game pad. Check a recommended build here.


Some interesting links: