0
$\begingroup$

Rosanswers logo

I am compiling ROS2 galactic through Yocto for an imx8qm. The only thing that doesn't work is rosbag2-py. When I run ros2 bag on the device, I get the error: Failed to load entry point 'play' : No module named 'rosbag2_py._reader'. In the /usr/lib/python3.10/site-packages/rosbag2-py folder, all of the files end in 'cpython-310-x86_64-linux-gnu.so'. I would expect them to be 'cpython-310-aarch64-linux-gnu.so', so it looks like Yocto isn't cross-compiling them. How do I change the yocto recipe so that the python libraries are cross-compiled?

Update: file I run the 'file' command on the librarys, I can see that the files are being built for ARM aarch64, even though they are named '..x86_64..'. The problem seems to be that ros2 bag isn't finding them properly.


Originally posted by eburley on ROS Answers with karma: 16 on 2023-05-02

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The problem was that the so files were not being named correctly. I added a bbappend file with the following fix:

do_install:append() { install -d ${D}${PYTHON_SITEPACKAGES_DIR} for f in $(find ${D}${PYTHON_SITEPACKAGES_DIR} -name "*x86_64*"); do mv $f $(echo $f | sed 's/x86_64/aarch64/') done }

This renames all of the *.cpython-310-x86_64-linux-gnu.so files to *.cpython-310-aarch64-linux-gnu.so. Now ros2 bag finds the modules correctly.


Originally posted by eburley with karma: 16 on 2023-05-02

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.