ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Can't run rosbag2-py on imx8

asked 2023-05-02 12:53:19 -0500

eburley gravatar image

updated 2023-05-02 13:44:08 -0500

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-02 13:58:23 -0500

eburley gravatar image

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.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2023-05-02 12:53:19 -0500

Seen: 130 times

Last updated: May 02 '23