A command-line tool to deal with Kria's clumsiness.
Project description
kria-movex README
Installation
To install the packages, run the following command:
pip install -r requirements.txt
Docker Configuration
When we compile a ROS2 node from our machines, this node will be compiled for the architecture of the pc used (e.g. x86, ...), while we want the node to be compiled for arm64 (or aarch64) to stay consistent with the Kria architecture. IMPORTANT: run the docker image before using movex.
Compose-based procedure (suggested)
-
Download docker image from docker hub:
docker pull doclorenzo/mmr-cross-compilation:1.0
-
Run the docker image:
SRC_PATH=<mmr-kria-drive-path> docker compose run --rm mmr-cross-compile-container
Set
mmr-kria-drive-pathto the absolute path of themmr-kria-drivesource code
Manual procedure
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 mmr-kria-drive folder
Understand Dockerfile
The Dockerfile contains in the first line the starting image, that is ubuntu 22.04 for arm64, and then executes (via “RUN”) all the shell commands needed to install ROS2, which can be found on the official documentation of ROS2 humble, with some differences.
Important choices
DEBIAN_FRONTEND=noninteractive: When installing the ros-dev-tools package, you are prompted to enter the timezone. This variable allows you to bypass this deadlockrosdep install && COPY: Before launching rosdep install, which will install all the dependencies of the libraries used inside our ros nodes, we need to give it the workspace from which to find these dependencies. TheCOPYbrings this workspace inside the image, so we need to put as the first argument of theCOPYthe folder in which the ros nodes are contained whose dependencies we want to resolve.ros-humble-: All ros-humble- packages are the libraries used inside ros2 nodes, specifically in “canbus_bridge” and “canopen_bridge” at the time of writing this documentation.
FROM arm64v8/ubuntu:22.04
RUN apt update && apt install -y locales
RUN locale-gen en_US en_US.UTF-8
RUN update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
RUN export LANG=en_US.UTF-8
RUN apt install -y software-properties-common
RUN add-apt-repository universe
RUN apt update && apt install curl -y
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
RUN apt update
RUN apt install -y python3-flake8-docstrings
RUN apt install -y python3-pip
RUN apt install -y python3-pytest-cov
RUN DEBIAN_FRONTEND=noninteractive apt install -y ros-dev-tools
RUN apt install -y ros-humble-ament-cmake
RUN apt install -y ros-humble-rclcpp
RUN apt install -y ros-humble-geometry-msgs
RUN apt install -y ros-humble-std-msgs
RUN apt install -y ros-humble-can-msgs
RUN rosdep init
RUN rosdep update --rosdistro humble
COPY mmr-kria-drive/ /home
RUN rosdep install --from-paths /home/src --rosdistro humble --ignore-src -y --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers"
RUN apt install ros-humble-sensor-msgs
Usage
Throubleshooting
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:
Docker configuration
-
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 $USER
then reboot your system.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file movex-1.0.tar.gz.
File metadata
- Download URL: movex-1.0.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48dd1b83fd4358b651b33d1f3800cfb8f8bc8542a1533494eed8e2c4e44e8946
|
|
| MD5 |
5c335c435fefa3a791cd0766d21a23fa
|
|
| BLAKE2b-256 |
476f25e5fe60638b4e2395624976df851e1f8baae6181b18945ad3b3a15a170a
|
File details
Details for the file movex-1.0-py3-none-any.whl.
File metadata
- Download URL: movex-1.0-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86a2a2177fc2f4a60f9276f907b2e60118a507910e148cd236a9385b2fca6897
|
|
| MD5 |
54f8de721795c246198b6bee0bc2ec56
|
|
| BLAKE2b-256 |
1926659d1588621a168dc1f0394aaae540d949b9f5efede5384be57c7e056cc3
|