ros-tooling / setup-ros

Github Action to set up ROS 2 on hosts
Apache License 2.0
85 stars 38 forks source link

Adding an optional paramater to install specified ros packages #704

Open sauk2 opened 4 days ago

sauk2 commented 4 days ago

Description

Adding an optional parameter for the user to specify additional ros packages for installation. An alternative considered here is using action-ros-ci but it feels like a force fit.

An example use case would be the option to install an appropriate version of ros-gz-bridge while installing ROS 2 and Gazebo side-by-side.

Related Issues

There are no dependencies for this feature nor is it part of a larger project.

Completion Criteria

Implementation Notes / Suggestions

The optional parameter in action.yml takes multiple string inputs of ROS package names. This package name should be concatenated with the distro name to run an install command on a list of packages. For an invalid package name, the code should throw an error.

Testing Notes / Suggestions

Write tests to check if an invalid package input throws an error.

christophebedard commented 3 days ago

I don't see a critical need to add a feature like this to setup-ros, because it's probably not the right way to do it.

You could just install the packages yourself:

jobs:
  test:
    strategy:
      matrix:
        ros_distribution
          - jazzy
          - rolling
    steps:
      - uses: ros-tooling/setup-ros@v0.7
        with:
          required-ros-distributions: ${{ matrix.ros_distribution }}
      - run: sudo apt-get update && sudo apt-get install -y ros-${{ matrix.ros_distribution }}-package

If you're using action-ros-ci and the packages you're building & testing depend on other packages, then those should be declared as dependencies in the package.xml, and rosdep will install them.

Am I missing something?