ros-tooling / cross_compile

A tool to build ROS and ROS2 workspaces for various targets
Apache License 2.0
187 stars 59 forks source link

ros2 command not found on target #335

Closed suyash-narain closed 3 years ago

suyash-narain commented 3 years ago

i was following the ros_cross_compile tutorial for aarch64 environment, and was able to generate install_aarch64 directory, which i copied over to my aarch64 target. i was able to source install_aarch64/setup.bash as well on target but when i ran ros2 run demo_nodes_cpp talker i get the error ros2: command not found do i need to have ros2 installed on my target as well? isn't the point of cross-compilation be to be able to use memory intensive applications onto arm64 targets which have memory constraints?

thanks

emersonknapp commented 3 years ago

Please read the README section https://github.com/ros-tooling/cross_compile#using-the-build-on-a-target-platform - you need to install anything that was outside of your workspace into the target environment.

The definition of cross-compilation is to build binaries for some architecture, but doing that build on a different architecture.

Memory considerations are important in many cross-compile situations, but it is a separate thing. In this case, if you want to run a ros2 application on a device, you need to have ros2 installed.

If you are trying to target a platform that does not have released ROS2 binaries for aarch64, you will need to cross-compile all dependencies as well. See the "supported platforms" section of the README https://github.com/ros-tooling/cross_compile#using-the-build-on-a-target-platform