# Voxl2 PID building and deployment on RB5

Source: https://forum.modalai.com/topic/3498/voxl2-pid-building-and-deployment-on-rb5
Category: VOXL SDK and Software (https://forum.modalai.com/category/47/voxl-sdk-and-software)
Tags: px4-firmware, pid, voxl2, rb5
Posted: 2024-05-29 14:47:52 UTC by tahawaru
Replies: 21 · Views: 7257

## tahawaru · 2024-05-29 14:47:52 UTC

Hi,

We have 7 RB5s from modalai running Voxl2.
From the following source code https://discuss.px4.io/t/modal-ai-rb5-drone-and-mavros/28303,
we have modified the code for the PID at px4-firmware/src/lib/pid.

How to build the new code, deploy and test it on the RB5?

cc":@Amin Bassiri

Best wishes,

## Reply by Eric Katzfey (ModalAI staff) · 2024-05-29 15:23:09 UTC

@tahawaru This docker: https://gitlab.com/voxl-public/rb5-flight/rb5-flight-px4-build-docker#rb5-flight-px4-build-docker is the build environment. This is the repo that has PX4: https://gitlab.com/voxl-public/voxl-sdk/services/voxl-px4/-/blob/master/README.md?ref_type=heads

## Reply by tahawaru · 2024-06-07 08:07:00 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 

My laptop has Ubuntu 22.04

I have the following details for the rb5:
rb5:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.5 LTS
Release:	18.04
Codename:	bionic

XXXX@ZZZZ:~$ adb shell px4-versions 

modalai-slpi 1.1-10 

px4-support/now 1.0-6 arm64 [installed,local] 

voxl-px4/unknown,now 1.14.0-2.0.63 arm64 [installed,automatic] 

voxl-px4-imu-server/unknown,now 0.1.2 arm64 [installed,automatic] 

voxl-px4-params/unknown,now 0.3.3 arm64 [installed,automatic] 

libfc-sensor/now 1.0-4 arm64 [installed,local] 

1.7.1-M0052-14.1a-perf-nightly-20231025 

adb shell px4-ver all
* daemon not running; starting now at tcp:5037
* daemon started successfully
HW arch: MODALAI_VOXL2
PX4 git-hash: b02a6b4ae93d12fa399673bf442c45087cee0759
PX4 version: 1.14.0 0 (17694720)
Vendor version: 2.0.63 0 (33570560)
OS: Linux
OS version: Release 4.19.125 (68386303)
Build datetime: Dec 11 2023 20:06:45
Build uri: localhost
Build variant: default
Toolchain: GNU GCC, 7.5.0
PX4GUID: 100a41444f4d5649414c324c584f30303030
UNKNOWN MCU

May I proceed with the build though it's stated at https://gitlab.com/voxl-public/rb5-flight/rb5-flight-px4-build-docker#rb5-flight-px4-build-docker 

"Getting started
The build environment for PX4 on RB5 Flight is only supported on Ubuntu 20.04 LTS (Focal Fossa)."

Best wishes,

## Reply by tahawaru · 2024-06-07 09:06:03 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 

Here are the steps I followed to o download QualcommPackageManager.2.0.21.1.Linux-x86.deb:
1)https://developer.qualcomm.com/download/software 

2) click on Hexagon SDK (https://developer.qualcomm.com/software/hexagon-dsp-sdk/tools) 

3)Download Qualcomm Package Manager - Linux v2.0

## Reply by tahawaru · 2024-06-07 13:07:32 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 
![ef7a9fd9-6cda-4ff0-8193-3364a8269370-image.png](https://forum.modalai.com/assets/uploads/files/1717765637828-ef7a9fd9-6cda-4ff0-8193-3364a8269370-image.png)

## Reply by Eric Katzfey (ModalAI staff) · 2024-06-07 16:12:56 UTC (in reply to tahawaru)

@tahawaru We have only tested with Ubuntu 20.04. Should work on Ubuntu 22.04 but we don't know for sure.

## Reply by Eric Katzfey (ModalAI staff) · 2024-06-07 16:14:03 UTC (in reply to tahawaru)

@tahawaru The instructions say Hexagon SDK 4.x. Your picture shows Hexagon SDK 6.x highlighted. That is not correct. Please follow the instructions exactly.

## Reply by tahawaru · 2024-06-10 14:31:48 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 

I cannot find Hexagon SDK 4.x..
Where's it?

Best wishes,

## Reply by Eric Katzfey (ModalAI staff) · 2024-06-10 15:45:40 UTC (in reply to tahawaru)

@tahawaru Scroll down on the menu

## Reply by tahawaru · 2024-06-11 16:14:59 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 
Thank you.
Now I'm here
![37a64fb5-703f-4415-9f20-e7767a2643bb-image.png](https://forum.modalai.com/assets/uploads/files/1718122455498-37a64fb5-703f-4415-9f20-e7767a2643bb-image.png)

## Reply by tahawaru · 2024-06-11 16:24:46 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 

After installing libssl1.1
![53a48c9a-c0c8-48d6-afe7-957eacca0dce-image.png](https://forum.modalai.com/assets/uploads/files/1718123062982-53a48c9a-c0c8-48d6-afe7-957eacca0dce-image.png)

## Reply by Eric Katzfey (ModalAI staff) · 2024-06-11 18:55:25 UTC (in reply to tahawaru)

@tahawaru I'm afraid I cannot help much with the Qualcomm Package Manager. It is really difficult to deal with. Sometimes it appears to be dead and I have to just let it sit for a long time before it finally responds. It is very frustrating to use it but there really isn't much that we can do about it. The good news is that once you finally get it to download the SDK you don't have to deal with it anymore. Sometimes is appears like it didn't do anything but did actually download what you need.

## Reply by Eric Katzfey (ModalAI staff) · 2024-06-11 18:57:23 UTC (in reply to tahawaru)

@tahawaru Take a look in /local/mnt/workspace. It may have placed the SDK there.

## Reply by tahawaru · 2024-06-12 15:24:01 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 

Thank you.

I got a few errors during the build(-- Detecting C compiler ABI info - failed
)
But it got to
*** End of qurt slpi build ***
/usr/local/workspace
User ID is 1000
Group ID is 1000
*** End of build ***

and 
root@27a3c2a4a155:/usr/local/workspace# ./make_package.sh 
Package Name:  voxl-px4
version Number:  1.14.0-2.0.77
starting building Debian Package
dpkg-deb: building package 'voxl-px4' in 'voxl-px4_1.14.0-2.0.77_arm64.deb'.
DONE
root@27a3c2a4a155:/usr/local/workspace# 

I haven't tested the new build yet.
Hopefully will be fine.

## Reply by tahawaru · 2024-06-27 12:21:56 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 

We have deployed the newly build px4 into a Rb5 with the following configuration:

system-image: 1.7.1-M0052-14.1a-perf-nightly-20231025
kernel:       #1 SMP PREEMPT Thu Oct 26 05:24:02 UTC 2023 4.19.125
--------------------------------------------------------------------------------
hw version:   M0052
--------------------------------------------------------------------------------
voxl-suite:   1.1.2

Problem: 
we have started the service voxl-px4 with the systemctl command but it stops running after a while.

Questions: Why? Do we need some additional things to do for the new build to work?

Best wishes,

## Reply by Eric Katzfey (ModalAI staff) · 2024-06-27 14:14:43 UTC (in reply to tahawaru)

@tahawaru You need to start with a version of voxl-px4 that is compatible with the version of SDK you are using. So, if you are using SDK 1.1.2 then you will need to start with voxl-px4 1.14.0-2.0.63 and add your changes on top of that.

## Reply by tahawaru · 2024-06-28 07:51:26 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 

Where can we find such old version?

Our current voxl-px4 build output is voxl-px4_1.14.0-2.0.77_arm64.deb

Best wishes,

## Reply by Eric Katzfey (ModalAI staff) · 2024-06-28 15:08:03 UTC (in reply to tahawaru)

@tahawaru https://gitlab.com/voxl-public/voxl-sdk/services/voxl-px4/-/tags/v1.14.0-2.0.63

## Reply by tahawaru · 2024-07-01 15:00:01 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 

We have built the voxl-px4 using the link for voxl-px4 1.14.0-2.0.63 and the instructions.
At the end, we still have voxl-px4_1.14.0-2.0.77_arm64.deb, not voxl-px4_1.14.0-2.0.63_arm64.deb.

What should we do differently?

Best wishes,

## Reply by Eric Katzfey (ModalAI staff) · 2024-07-02 18:37:55 UTC (in reply to tahawaru)

@tahawaru Somewhere along the line you didn't get the correct source code from git. What does `git log` say for the voxl-px4 repo? If you go into the `px4-firmware` subdirectory (submodule), what does it show you for `git log`? These basic git commands will help you determine what you have fetched and are actually building.

## Reply by tahawaru · 2024-07-30 09:49:19 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 

this is the git log output:

commit 96b951b7cf91cda315536037677ca0f7a7ef93b5 (HEAD -> dev, origin/dev)
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Wed Jul 10 17:40:54 2024 -0700

    Updated to 1.14.0-2.0.78 firmware

commit a99bf3ac158e5dff767cdbfe40ee62f1937cf49c (tag: v1.14.0-2.0.77, tag: sdk-1.3.1, origin/master, origin/gpio-ctl, origin/HEAD, master)
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Wed Jun 5 16:52:13 2024 -0700

    Updated to 1.14.0-2.0.77 firmware

commit 41432f2cbf334c7cd8dcb096e6b0d53649aa229d
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Thu May 30 11:04:03 2024 -0700

    Updated to 1.14.0-2.0.76 firmware

commit bf8fd8c2a8187ba96572b6c5e87b2ca437ae7c90
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Tue May 28 19:55:03 2024 -0700

    Updated to 1.14.0-2.0.75 firmware

commit 05633367a60e27be224228979687b82e4d70ee6d
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Thu May 23 10:38:06 2024 -0700

    - Updated to 1.14.0-2.0.74 firmware
    - Added new ARTIFACT_MODE configuration item

commit a8a74cf7524f84997353c1740701d1ebd198ff4c (tag: v1.14.0-2.0.73, tag: sdk-1.3.0)
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Mon May 6 17:24:05 2024 -0700

    Updated to 1.14.0-2.0.73 firmware

commit 18390fc1809199050d7f1075f753676718807ea8
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Fri May 3 10:09:15 2024 -0700

    Removed package command related to voxl-px4-set-default-parameters.config

commit 2a76d2027f981405e736bfef1a26a82589638f44
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Fri May 3 09:58:02 2024 -0700

    Updated package dependency list and release documentation

commit e35422dd8ee04da5adf710dd37aab4d24fe9125e
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Fri May 3 09:50:32 2024 -0700

    Updated to 1.14.0-2.0.72 firmware

commit ed9451173b2a4de183ab1e1c8308780e05c056dc
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Tue Apr 16 12:52:21 2024 -0700

    Updated to 1.14.0-2.0.70 firmware

commit 478a3c0a2726abb57187c3039d4576294edd42f4
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Tue Feb 6 12:55:10 2024 -0800

    Updated to 1.14.0-2.0.69 firmware

commit 486f57c0cc6fd3026eb3cabe7fbfeb4214caefaa (tag: v1.14.0-2.0.68, tag: sdk-1.2.0)
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Thu Jan 18 16:13:44 2024 -0800

    Updated to 1.14.0-2.0.68 firmware

commit f690d9c7389fb3d002efd68443707988171d8ac7
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Thu Jan 18 14:52:53 2024 -0800

    Updated to 1.14.0-2.0.67 firmware

commit 6df44c7fc276ff1f03e21dcace4f3f634ff1f1e3
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Mon Jan 15 09:54:48 2024 -0800

    Updated to 1.14.0-2.0.66 firmware

commit 4233c76f61db535aefe264f418558cecc0e0f24c
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Mon Jan 8 10:36:48 2024 -0800

    Updated to 1.14.0-2.0.65 firmware

commit 7c7b648018c33647476308d406ef2e5acaa858f3
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Tue Dec 19 11:17:57 2023 -0800

    Fixes to 1.14.0-2.0.64 firmware

commit a6d8319122470c89c942fbc0c6ffba492d3441f9
Author: Eric Katzfey <eric.katzfey@modalai.com>
Date:   Tue Dec 19 09:44:33 2023 -0800

    Updated to 1.14.0-2.0.64 firmware
:

## Reply by Eric Katzfey (ModalAI staff) · 2024-07-30 15:05:06 UTC (in reply to tahawaru)

@tahawaru Okay, that shows you have 1.14.0-2.0.78. If you want to build 1.14.0-2.0.63 then you need to check that version out instead.
