The way that it works is:
- Any dependencies needed by the ROS packages has to be precompiled and ready for the aarch64, placed on the Ubuntu image, and linked agains in the compilation process
- You might find some of the well known packages precompiled for ARM (aarch64) that works on EulerOS (the ones compiled for Fedora-29 are compatible). I usually search on https://rpmfind.net/ website for these packages if there is any.
- If you can not find a precompiled library/dependency you have to cross compile that first
- When you have the dependency ready on the image file, you have to copy it to the exact same path on the HiLens to be able to use them. There is a copy of HiLens system root folder on the Ubuntu image in “/opt/aarch64-linux-gnu-gcc-7.3.0/sysroot” which acts as “/” folder on the HiLens device. This folder is used by the “aarch64-linux-gnu-gcc-7.3.0” compiler which does the cross compilation for aarch64. For instance you can copy the dependency libraries to “/opt/aarch64-linux-gnu-gcc-7.3.0/sysroot/lib64” on the image for compiling and “/lib64” on the HiLens device for using it
- For using them in ROS packages, you can add them to “/ros_catkin_ws/rostoolchain.cmake” file we have provided (you might need to modify CMakeList file in the ROS package accordingly, for instance if the package does not have cmake config file the “find_package” command in CMake will not be able to find them, and you have to remove the “find_package( REQUIRED)” line in the CMakeList file and add “_LIBS”, “_INCLUDE_DIRS” and other pathes needed manually in rostoolchain.cmake file)
它的工作方式是:
-
ROS包所需的任何依赖项都必须预先编译并准备好用于aarch64,放在Ubuntu映像上,并在编译过程中链接agains
-
您可能会发现一些为ARM(aarch64)预先编译的、在EulerOS上工作的著名包(为Fedora-29编译的包是兼容的)。我通常在 https://rpmfind.net/ 网站上搜索这些包(如果有的话)。
-
如果找不到预编译的库/依赖项,则必须首先交叉编译
-
当你在图像文件上准备好依赖关系时,你必须将它复制到HiLens上完全相同的路径才能使用它们。在HiLens设备上的“/opt/aarch64-linux-gnu-gcc-7.3.0/sysroot”文件夹中,有一个HiLens系统根文件夹的副本。此文件夹由“aarch64-linux-gnu-gcc-7.3.0”编译器使用,该编译器对aarch64进行交叉编译。例如,您可以将依赖项库复制到映像上的“/opt/aarch64-linux-gnu-gcc-7.3.0/sysroot/lib64”以进行编译,并复制到HiLens设备上的“/lib64”以使用它
-
对于在ROS包中使用它们,您可以将它们添加到我们提供的“/ROS_catkin_ws/rostoolchain.cmake”文件中(您可能需要相应地修改ROS包中的CMakeList文件,例如,如果包没有cmake配置文件,cmake中的“find_package”命令将无法找到它们,您还必须删除CMakeList文件中的“find_package(REQUIRED)”行,并在rostoolchain.cmake文件中添加“\u LIBS”、“\u INCLUDE_DIRS”和其他手动需要的路径)