How to execute local_setup.bash generated in cross-compilation environment?
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 ...
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).ThanksHi 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.