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

Not all defaults.yaml arguments are recognised #366

Closed Makekihe closed 1 year ago

Makekihe commented 1 year ago

Description

I've followed the tutorial which you presented in the ReadME. Now I'm trying to get to know the defaults.yaml file, as I would have to modify this when I start to include my own ROS2 packages. As a soft start, I'm trying to change the name of the build directory (build-base), however, this is not reflected when running the cross-compilation (see my defaults.yaml below). What am I doing wrong? I'm only able to change the build directory name when doing it directly in the .local/lib/python3.8/site-packages/ros_cross_compile/docker/build_workspace.sh file.

Eventually, I would need to adjust "--paths --build-base --install-base --symlink-install" in the defaults.yaml file to match my current shell script seen in "Additional context". Hints about the syntax required for this would be appreciated.

Additional question: The ReadME here shows one syntax for the defaults.yaml file, while the official colcon configuration documentation shows another configuration. Which syntax should I use?

Expected Behavior

The build directory should be named my_build instead of the default build_aarch64.

Actual Behavior

The build directory is still named its default name, namely build_aarch64 in my case.

To Reproduce

I'm simply following the guide you have on your ReadME.

  1. Create a directory and checkout sources

    mkdir -p cross_compile_ws/src
    cd cross_compile_ws
    git clone -b foxy https://github.com/ros2/demos src/demos
  2. Create a defaults.yaml file. It's a copy of the one from the guide, plus the build-base line.

    build:
    # only build the demo_nodes_cpp package, to save time building all of the demos
    build-base: "my_build"
    packages-up-to:
    - demo_nodes_cpp
    # make a merged install space, which is easier to distribute
    merge-install: true
    # add some output for readability
    event-handlers:
    - console_cohesion+
    - console_package_list+
  3. Run the cross-compilation ros_cross_compile . --rosdistro galactic --arch aarch64 --os ubuntu --colcon-defaults ./defaults.yaml

Host System

Target System

Additional context

My reason for looking into cross-compilation in the first place is that I am currently building my ROS2 Galactic software stack directly on the CM4, which takes ~45 min. On my computer, it takes ~5 min. I hope that through cross-compilation, I can build the software stack on my computer and then transfer the install files to the CM4 to be executed. This process, I hope, takes less than the current ~45 min. Do you guys believe this should be the case?

Eventually, I'll have to replicate these parts of my current shell script, but for the cross-compilation to a CM4.

bash_dir=$(dirname $(readlink -f $0))
colcon build --paths $bash_dir/../common/src/* $bash_dir/src/* --build-base $bash_dir/../build --install-base $bash_dir/../install --symlink-install "$@"