Ask Your Question
0

How to execute local_setup.bash generated in cross-compilation environment?

asked 2018-04-09 04:59:43 -0600

davidhuziji gravatar image

updated 2018-04-09 21:59:10 -0600

Hi,

I'd like to know how to setup ROS2 environment on arm platforms. I thought simply executing local_setup.bash can get all the things ready. But it doesn't work.

I build up ROS2 in cross-compilation environment on X86 PC. After the building completes, I just copy the install directory to an arm64 platform. I create the same directory on arm platform as that on X86 PC. I execute local_setup.bash on arm but the ROS2 binary cannot be found. Besides, It seems that some modules are neither found. For example, I get an error show as below when I run ROS2 command.

Traceback (most recent call last):  
   File "./ros2", line 5, in <module>
      from pkg_resources import load_entry_point
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
      @_call_aside
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
       f(*args, **kwargs)
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
       working_set = WorkingSet._build_master()
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 635, in _build_master
      ws.require(__requires__)
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 943, in require
      needed = self.resolve(parse_requirements(requirements))
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 829, in resolve
      raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'ros2cli==0.4.0' distribution was not found and is required by the application

Could you please tell me how to adjust local_setup.bash on arm platform so I can execute it as on X86 PC?

Updates:

After set AMENT_TRACE_SETUP_FILES, the output of local_setup.bash is showed as below.

. "<my_path>/install/local_setup.sh"
. "<my_path>/install/share/ament_clang_format/local_setup.bash"
. "<my_path>/install/share/ament_clang_format/local_setup.sh"
. "<my_path>/install/share/ament_clang_format/environment/ament_prefix_path.sh"
. "<my_path>/install/share/ament_clang_format/environment/path.sh"
. "<my_path>/install/share/ament_clang_format/environment/pythonpath.sh"
. "<my_path>/install/share/ament_copyright/local_setup.bash"
. "<my_path>/install/share/ament_copyright/local_setup.sh"
. "<my_path>/install/share/ament_copyright/environment/ament_prefix_path.sh"
. "<my_path>/install/share/ament_copyright/environment/path.sh"
. "<my_path>/install/share/ament_copyright/environment/pythonpath.sh"
. "<my_path>/install/share/ament_cppcheck/local_setup.bash"
. "<my_path>/install/share/ament_cppcheck/local_setup.sh"
. "<my_path>/install/share/ament_cppcheck/environment/ament_prefix_path.sh"
. "<my_path>/install/share/ament_cppcheck/environment/path.sh"
. "<my_path>/install/share/ament_cppcheck/environment/pythonpath.sh"
. "<my_path>/install/share/ament_cpplint/local_setup.bash"
. "<my_path>/install/share/ament_cpplint/local_setup.sh"
. "<my_path>/install/share/ament_cpplint/environment/ament_prefix_path.sh"
. "<my_path>/install/share/ament_cpplint/environment/path.sh"
. "<my_path>/install/share/ament_cpplint/environment/pythonpath.sh"
. "<my_path>/install/share/ament_flake8/local_setup.bash"
. "<my_path>/install/share/ament_flake8/local_setup.sh"
. "<my_path>/install/share/ament_flake8/environment/ament_prefix_path.sh"
. "<my_path>/install/share/ament_flake8/environment/path.sh"
. "<my_path>/install/share/ament_flake8/environment/pythonpath.sh"
. "<my_path>/install/share/ament_index_python/local_setup.bash"
. "<my_path>/install/share/ament_index_python/local_setup.sh"
. "<my_path>/install/share/ament_index_python/environment/ament_prefix_path.sh"
. "<my_path>/install/share/ament_index_python/environment/path.sh"
. "<my_path>/install/share/ament_index_python/environment/pythonpath.sh"
. "<my_path>/install/share/ament_lint_cmake/local_setup.bash"
. "<my_path>/install/share/ament_lint_cmake/local_setup.sh"
. "<my_path>/install/share/ament_lint_cmake/environment/ament_prefix_path.sh"
. "<my_path>/install/share/ament_lint_cmake/environment/path.sh"
. "<my_path>/install/share/ament_lint_cmake/environment/pythonpath.sh"
. "<my_path>/install/share ...
(more)
edit retag flag offensive close merge delete

Comments

I don't think we ever tried this as we don't do cross compilation. Can you provide a full console output with AMENT_TRACE_SETUP_FILES enabled as well as you PYTHONPATH and other relevant information (what command you ran to build the workspace, what target operating system you're using etc).Thanks

marguedas gravatar image marguedas  ( 2018-04-09 09:57:37 -0600 )edit

Hi marguedas, thanks for your reply.

Could you please see my updates? I append them to the question.

I create the same directory on arm platform as that on X86 PC. Thus the prefix and directory value is not a issue anymore. But the error still exists.

davidhuziji gravatar image davidhuziji  ( 2018-04-09 22:00:33 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-04-20 00:49:44 -0600

davidhuziji gravatar image

Hi,

I download the latest code and force ROS2 to use Python3 on arm platform. Although there are still errors dumped, the demo can run. Thanks.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-04-09 04:59:43 -0600

Seen: 215 times

Last updated: Apr 20 '18