Movex supports three subcommands:
- move: moves a ROS2 node from the host to the Kria's micro SD card
- expand: expands micro SD's root partition taking up all available free space
- build: cross-compile a ROS2 node on any host for Kria's arm64 architecture
Each subcommand has a different syntax and supports a different set of parameters.
Use -h option to retrieve it:
python3 -m movex {move,expand,build} -hInstall with pip by running:
pip install movexMake sure pip is invoked by, at least, python version 3.12.
Clone this repository.
To install the dependencies, run the following command:
pip install -r requirements.txtWhen we compile a ROS2 node from our machines, the node will be compiled for the architecture of the host PC (e.g. x86, ...), while we want the node to be compiled for arm64 (also named aarch64) to stay consistent with the Kria architecture. IMPORTANT: run the docker image at least once before using movex.
Download image from Docker Hub:
docker pull doclorenzo/mmr-cross-compilation:1.0Clone mmr-cross-compilation repository.
Run the docker image from compose file:
SRC_PATH=<mmr-kria-drive-path> docker compose run --rm mmr-cross-compile-containerSet mmr-kria-drive-path to the absolute path of the mmr-kria-drive source code
Clone mmr-cross-compilation repository.
If you are not willing to use the compose-based procedure, you can always opt for the manual procedure which involves build and interactive execution of the image.
-
Build container
docker build -t mmr-cross-compile <dockerfile_folder> --platform=linux/arm64/v8
- dockerfile_folder: path of the folder where it is contained the Dockerfile
-
Run the docker image:
docker run --platform=linux/arm64/v8 --rm -it --volume=<mmr-kria-drive-path>:/home/mmr-kria-drive <image_name>
- mmr-kria-drive-path: absolute path of the
mmr-kria-drivesource code - image_name: name of the contaier (e.g.
mmr-cross-compile)
- mmr-kria-drive-path: absolute path of the
ATTENTION: the changes that are made to the container in the
/homefolder will also be made inside the filesystem that launches the container, so in this case, in the folder
If you are here, we both know that something went wrong... don't give up and see if one of your problems (because there will be several of them) have a solution in the following list:
-
Can't build/run the docker image, giving back this error:
exec /bin/bash: exec format errorLet's give a try on this:
docker run --privileged --rm tonistiigi/binfmt --install all
for further information, checks the docker docs
-
Docker engine not found. Make sure to have a running Docker engine!
Probably the docker engine is not autorizhed to accept commands from your current user, try:
sudo usermod -aG docker $USERthen reboot your system.
-
Problem on expand on Ubuntu 22.04: older version of e2fsck and resize2fs
Download and compile from the e2fsprogs repository the newer versione of e2fsck and resize2fs.