# Building the edited source code

Source: https://forum.modalai.com/topic/1060/building-the-edited-source-code
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2022-06-27 18:45:46 UTC by IC
Replies: 14 · Views: 2493

## IC · 2022-06-27 18:45:46 UTC

Hello,

I've got the VOXL m500 and want to edit the voxl-vision-px4 source code to get the MoCap pose message instead of the VIO pose message to the EKF2. However, I am unsure of how to go about it.  Should I follow the build instructions given and build voxl-cross first and then use that to build the voxl-vision-px4 package? Will this override the voxl-vision-px4 package that comes as a part of the VOXL software suite? Or is there a way to edit and build the existing source code of the package on the VOXL?

## Reply by Guest · 2022-06-28 18:52:55 UTC

VVPX4 is built using the ```voxl-cross``` docker image, while we do have build instructions for that and you can build it yourself if you'd like, we also provide a standard pre-built one on our [downloads](https://downloads.modalai.com) page. After that you can follow the build/deploy instructions from the repo. Doing this will override the default one installed on your voxl, but you can always redownload and install the old one from our package repo if something goes wrong.

It is possible to build the packages on-board but we generally do not recommend or provide support for this since we've carefully set up the build environments and toolchains to set up the compilation correctly. This allows us to help debug in a reproducible manner as opposed to trying to debug custom source built in an unkown environment.

## Reply by IC · 2022-06-28 21:39:02 UTC (in reply to Guest)

@Alex-Gardner Thanks for the clarification!

I'm following the instructions [here](https://docs.modalai.com/voxl-cross/) to install the pre-built voxl-cross image but don't have the required directory. 

![Screenshot from 2022-06-28 17-32-43.jpg](https://forum.modalai.com/assets/uploads/files/1656452473716-screenshot-from-2022-06-28-17-32-43.jpg) 

Can I change the path to '~/bin/${RUN_SCRIPT}' in the script?

## Reply by Guest · 2022-06-29 16:26:41 UTC

The docker images are not meant to be run on voxl, they're made to emulate the voxl's environment on a desktop computer. You should install the script and image on your desktop, build there, and then use the deploy script to send the built package over to a voxl via adb or ssh

## Reply by IC · 2022-06-29 19:08:58 UTC (in reply to Guest)

@Alex-Gardner Right. Thank you!

I'm trying to build the VVPX4 using the voxl-cross image on my desktop but I'm getting the following errors.
![Screenshot from 2022-06-29 15-02-18.png](https://forum.modalai.com/assets/uploads/files/1656529353330-screenshot-from-2022-06-29-15-02-18.png) 

Any pointers to what I might be missing?

## Reply by Guest · 2022-06-29 19:54:29 UTC

Did you run the install_build_deps script?

## Reply by IC · 2022-06-29 20:28:08 UTC (in reply to Guest)

@Alex-Gardner Yes, I did.

![2nd.png](https://forum.modalai.com/assets/uploads/files/1656534322591-2nd.png)

## Reply by Guest · 2022-06-29 22:51:25 UTC

You should only be installing/building for one platform (both in general but especially within a single docker instance). APQ8096 is the processor on VOXL and QRB5165 is the processor on RB5 Flight/VOXL2.

For this specific issue though, it looks like you need to be pulling from the ```staging``` repo, not the ```stable``` one since you're building effectively the staging version of vvpx4 (stable would be on the sdk-0.7 tag). The function you're missing was added in libmodal-pipe 2.1.8 but stable has 2.1.7

## Reply by IC · 2022-06-30 17:49:24 UTC (in reply to Guest)

@Alex-Gardner Right. Thanks a lot!

When deploying to VOXL, I'm getting the following message:
![3.png](https://forum.modalai.com/assets/uploads/files/1656611214881-3.png) 

From what I understand the VVPX4 is not overridden by the new VVPX4 package pushed to the VOXL. Do I need to change the VVPX4 version in any of the scripts?

## Reply by Guest · 2022-06-30 18:09:31 UTC

Ah that's the last issue, our latest stuff requires a tweak to the opkg environment to allow packages marked arm64 (we're so very close to releasing a new system image with this in it),  if you add the line ```arch arm64 7``` to ```/etc/opkg/arch.conf``` you'll be able to install the package you just built.

## Reply by IC · 2022-06-30 19:41:52 UTC (in reply to Guest)

@Alex-Gardner Apparently not the last for me!

So now the package is configured but not installed:
![4.png](https://forum.modalai.com/assets/uploads/files/1656618056160-4.png) 
And VOXL does not connect to QGC now. I tried reinstalling the unedited package and get the same message and no connection to QGC.

## Reply by IC · 2022-06-30 21:28:33 UTC (in reply to Guest)

@Alex-Gardner And factory resetting it 
```
voxl-configure-mpa --factory-reset
```
shows the following:

```
Configuring VOXL Vision PX4

wiping old config file
voxl-vision-px4: error while loading shared libraries: libmodalcv.so.1: cannot open shared object file: No such file or directory
enabling  voxl-vision-px4 systemd service
starting  voxl-vision-px4 systemd service
Done configuring voxl-vision-px4
```

## Reply by Guest · 2022-06-30 23:49:47 UTC

I've uploaded the most recent platform release ([3.8.0-0.7](https://developer.modalai.com/asset/1)) for VOXL with a number of important changes to support our most recent stuff. If you flash this new platform and then deploy your custom VVPX4, there shouldn't be any more issues.

## Reply by IC · 2022-07-01 17:39:07 UTC (in reply to Guest)

@Alex-Gardner Great, thanks!

## Reply by IC · 2022-08-28 22:40:35 UTC

Hi,

I've been trying to deploy VVPX4 and still see some dependencies. I am using the VOXL Platform 3.8.0-0.7 and VOXL-Cross-2.1 docker image. 

```
voxl-vision-px4-master $./deploy_to_voxl.sh 
searching for ADB device
checking VOXL for dpkg/opkg
opkg detected
voxl-vision-px4_1.2.0.ipk: 1 file pushed. 3.4 MB/s (105362 bytes in 0.029s)
Reinstalling voxl-vision-px4 (1.2.0) on root.
Configuring voxl-vision-px4.
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for voxl-vision-px4:
 * 	libmodal-pipe (>= 2.4.0) * 	libmodal-cv (>= 0.1.0) * 
DONE

```
Maybe I have to build the following in a specific directory but I am not sure which one:
```
$ mkdir cross-workspace
$ cd cross-workspace
$ voxl-docker -i voxl-cross:V1.9
voxl-cross:~$ git clone https://gitlab.com/voxl-public/voxl-sdk/core-libs/libmodal-json.git
voxl-cross:~$ cd libmodal-json/
voxl-cross:~$ ./build.sh qrb5165
```
Can I install or source these two dependencies separately?
