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

how do I install rclpy on an arm processor with ros2?

asked 2018-08-07 11:16:59 -0600

LiamNelson gravatar image

updated 2018-08-07 12:54:31 -0600

I'm currently trying to get ros2 working on my pi zero w with an arch Linux os (still, for those who saw my last few posts). After following the instructions from the ROS2 on arm architecture git page below, I get a response that the system is missing rclpy. Since I can't get rclpy to install with ros2, I was thinking about installing it separately but I can't make the process work. Does anyone know how I can install rclpy on its own?


Here's a link to the page I followed so far:

edit retag flag offensive close merge delete



The instructions you refer to explicitly ignore building rclpy. Therefore it isn't available afterwards. I am not sure why the instructions leave it out - probably it is much more "difficult", You might want to open a ticket on the repository providing the instructions asking for rclpy support.

Dirk Thomas gravatar image Dirk Thomas  ( 2018-08-10 11:26:34 -0600 )edit

If you check out our progress so far here you'll see that we left python support in because we intend to use those capabilities when this bug is fixed.

LiamNelson gravatar image LiamNelson  ( 2018-08-10 11:34:40 -0600 )edit

I think this issue may be related to the python build not using the crosscompiler toolchain. It builds 64bit *.so files for rclpy instead of the 32bit that the crosscompiler should make. Not entirely sure where this change should be made to fix...

austinstig gravatar image austinstig  ( 2018-08-10 11:39:09 -0600 )edit

Yes, the instructions does not specify how to build python related packages because it requires additional steps that are not currently described. It is harder to get a list of easy steps as it requires more dependencies that needs to be already cross-compiled. Feel free to open an issue.

pokitoz gravatar image pokitoz  ( 2018-08-14 08:11:37 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2018-08-07 13:19:40 -0600

updated 2018-08-07 13:53:13 -0600

You can cross compile python packages you need the necessary libraries. You can either:

  1. Specify the libraries path to cmake to build this package. But you will have to cross compile them. Maybe by following ?
  2. sshfs the filesystem of your OS running on the pi zero. Prior to that, get all the necessary libraries using apt-get. Specify CMAKE_SYSROOT variable and cross-compile ROS2.
  3. Mount your filesystem on your host, use qemu, use apt-get to have the necessary missing libs, specify the CMAKE_SYSROOT, cross-compile ROS2, install the filesystem on the pi zero. ( )

I used 2. and 3. to install python packages.

edit flag offensive delete link more


Thanks for the answer. We made good progress with the second option and have compiled all but 4 libraries before encountering a new problem. The compiler gives back an error related to a LONG_BIT which we believe is the result of trying to compile for a 32 bit device as a 64 bit system.

LiamNelson gravatar image LiamNelson  ( 2018-08-08 16:28:44 -0600 )edit

We are currently trying to use crosstools-ng with arm version 6 to fix this problem but if you have a different method that you believe would get us past this issue, that would be great. I was planning on making a new post for this but, when we get it all working, we plan on making a full post then.

LiamNelson gravatar image LiamNelson  ( 2018-08-08 16:30:14 -0600 )edit

I never tried crosstools-ng. However it looks nice! I cannot see what your issue is. Could you add more details? But as you said, LONG_BIT errors seems like you are building for 64bit instead of 32bit.

pokitoz gravatar image pokitoz  ( 2018-08-09 04:03:36 -0600 )edit

if you check out this GitHub page you'll see the steps we took to reach this point: Right now, we fixed the LONG_BIT error but the system won't recognize rclpy. (due to what we think is a linker error)

LiamNelson gravatar image LiamNelson  ( 2018-08-10 09:14:55 -0600 )edit

Maybe someone has an idea if you share the linker error.

Dirk Thomas gravatar image Dirk Thomas  ( 2018-08-10 11:40:21 -0600 )edit

The error we got looks like this:

Failed to load entry point 'launch': No module named 'rclpy._rclpy'

Failed to load entry point 'echo': No module named 'rclpy._rclpy'

usage: ros2 [-h] Call ros2 <command> -h for more detailed usage. ...

LiamNelson gravatar image LiamNelson  ( 2018-08-10 11:46:34 -0600 )edit

We ran strace as well, but the results weren't very helpful since they pointed to permission errors within the _pycache_

LiamNelson gravatar image LiamNelson  ( 2018-08-10 11:50:38 -0600 )edit

That is not a linker error. The shared library containing the C extension can't be loaded at runtime. You might want to check if the library was built and installed correctly and the env is setup correctly so that it can be found and loaded.

Dirk Thomas gravatar image Dirk Thomas  ( 2018-08-10 11:54:55 -0600 )edit

answered 2018-09-05 16:10:09 -0600

Manny gravatar image

updated 2018-09-05 21:54:28 -0600

Hey guys, so I've been trying to install ros2 for the last few hours and I think I understand the situation, but do not know how to solve it.

At first this would seem it is an environment issue, where maybe the $PYTHONPATH is not set correctly. This is not the case though, Python 3.5 comes with ros2 installed and all of the site packages along with it.

When I go to the site packages directory, rclpy does exist. Therefore, the package is installed and python is definitely detecting it.

So I was curious, where is this python module? I went to highest level of the ros2 installation and applied this command to search for any text within that contains references the missing module

grep -r "rclp._rclpy" .

Nothing comes up. I'm at a loss.

edit: So I was doing all of this on Gallium OS (Ubuntu Xenial), and decided to simply install Ubuntu 18.04 and be done with it. Problem Fixed.

edit flag offensive delete link more

answered 2018-08-14 10:05:28 -0600

esteve gravatar image

You could give a try, it uses Docker and QEmu to have a complete sysroot that you can use for linking against your target architecture (in my case the RPI2/3)

edit flag offensive delete link more

Question Tools



Asked: 2018-08-07 11:16:59 -0600

Seen: 2,417 times

Last updated: Sep 05 '18