-
Notifications
You must be signed in to change notification settings - Fork 52
Add support for ROS-O (ROS One) distribution #854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # ./check-ros-distribution.sh <ROS distribution> | ||
| # ROS distribution must match the directory name for this distribution | ||
| # in /opt. E.g. melodic. | ||
|
|
||
| readonly ROS_DISTRIBUTION="$1" | ||
|
|
||
| # GitHub Action is erroneously setting PYTHONHOME to C:\python37 | ||
| unset PYTHONHOME | ||
| source "/opt/ros/${ROS_DISTRIBUTION}/setup.bash" | ||
| rosstack list |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,6 +101,22 @@ async function installRosAptSourcePackageIfNeeded( | |
| } | ||
| } | ||
|
|
||
| /** | ||
| * Add ROS-O (ROS One) APT repository key. | ||
| * | ||
| * Downloads and installs the GPG key for the ROS-O repository. | ||
| */ | ||
| async function addRosOneAptRepoKey(): Promise<void> { | ||
| // Ensure the keyrings directory exists and ca-certificates is up to date | ||
| await utils.exec("sudo", ["mkdir", "-p", "/etc/apt/keyrings"]); | ||
| await utils.exec("sudo", ["update-ca-certificates"]); | ||
| await utils.exec("sudo", [ | ||
| "bash", | ||
| "-c", | ||
| "curl -sSL https://ros.packages.techfak.net/gpg.key -o /etc/apt/keyrings/ros-one-keyring.gpg", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. who is behind this key and the repo? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Packages for this specific repository are build through https://github.com/ubi-agni/ros-builder-action/ and owned by @rhaschke at CITEC Bielefeld. It is pretty much the go-to repository for anyone to "just install ROS-O" these days.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the info! I would just mention this in the README so that people know that ROS-O debs are downloaded from a separate apt repo and not the usual Open Robotics apt repo. @iory can you add that?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done — added a note to the README in the latest commit. |
||
| ]); | ||
| } | ||
|
|
||
| // Ubuntu distribution for ROS 1 | ||
| const ros1UbuntuVersion = "focal"; | ||
|
|
||
|
|
@@ -121,6 +137,26 @@ function determineAptSourcePackageName( | |
| return `ros2${use_ros2_testing ? "-testing" : ""}-apt-source`; | ||
| } | ||
|
|
||
| /** | ||
| * Add ROS-O (ROS One) APT repository. | ||
| * | ||
| * @param ubuntuCodename the Ubuntu version codename | ||
| * @param use_testing whether to use the testing repository | ||
| */ | ||
| async function addRosOneAptRepo( | ||
| ubuntuCodename: string, | ||
| use_testing: boolean, | ||
| ): Promise<void> { | ||
| const arch = await utils.getArch(); | ||
| const repo = use_testing ? `${ubuntuCodename}-testing` : ubuntuCodename; | ||
| await utils.exec("sudo", [ | ||
| "bash", | ||
| "-c", | ||
| `echo "deb [arch=${arch} signed-by=/etc/apt/keyrings/ros-one-keyring.gpg] https://ros.packages.techfak.net ${repo} main" > /etc/apt/sources.list.d/ros-one.list`, | ||
| ]); | ||
| await utils.exec("sudo", ["apt-get", "update"]); | ||
| } | ||
|
|
||
| /** | ||
| * Initialize rosdep. | ||
| */ | ||
|
|
@@ -137,6 +173,19 @@ async function rosdepInit(): Promise<void> { | |
| await utils.exec("sudo", ["rosdep", "init"]); | ||
| } | ||
|
|
||
| /** | ||
| * Configure rosdep for ROS-O (ROS One). | ||
| * | ||
| * Adds custom rosdep source for ROS-O packages. | ||
| */ | ||
| async function configureRosOneRosdep(): Promise<void> { | ||
| await utils.exec("sudo", [ | ||
| "bash", | ||
| "-c", | ||
| 'echo "yaml https://ros.packages.techfak.net/ros-one.yaml one" > /etc/ros/rosdep/sources.list.d/1-ros-one.list', | ||
| ]); | ||
| } | ||
|
|
||
| /** | ||
| * Install ROS 1 or 2 (development packages and/or ROS binaries) on a Linux worker. | ||
| */ | ||
|
|
@@ -145,11 +194,21 @@ export async function runLinux(): Promise<void> { | |
| const use_ros2_testing = core.getInput("use-ros2-testing") === "true"; | ||
| const installConnext = core.getInput("install-connext") === "true"; | ||
|
|
||
| const requiredDistros = utils.getRequiredRosDistributions(); | ||
| // ROS-O "one" uses a separate repository (ros.packages.techfak.net). | ||
| const needsRosOne = requiredDistros.includes("one"); | ||
|
|
||
| await configOs(); | ||
|
|
||
| const ubuntuCodename = await utils.determineDistribCodename(); | ||
| await installRosAptSourcePackageIfNeeded(ubuntuCodename, use_ros2_testing); | ||
|
|
||
| // Add ROS-O repository if needed | ||
| if (needsRosOne) { | ||
| await addRosOneAptRepoKey(); | ||
| await addRosOneAptRepo(ubuntuCodename, use_ros2_testing); | ||
| } | ||
|
|
||
| if ("noble" !== ubuntuCodename && "resolute" !== ubuntuCodename) { | ||
| // Temporary fix to avoid error mount: /var/lib/grub/esp: special device (...) does not exist. | ||
| const arch = await utils.getArch(); | ||
|
|
@@ -170,7 +229,12 @@ export async function runLinux(): Promise<void> { | |
|
|
||
| await rosdepInit(); | ||
|
|
||
| for (const rosDistro of utils.getRequiredRosDistributions()) { | ||
| // Configure rosdep for ROS-O if needed | ||
| if (needsRosOne) { | ||
| await configureRosOneRosdep(); | ||
| } | ||
|
|
||
| for (const rosDistro of requiredDistros) { | ||
| await apt.runAptGetInstall([`ros-${rosDistro}-desktop`]); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the intent behind this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just lets us trigger the test workflow manually, which was handy for checking the ROS-O matrix. Happy to drop it if you'd prefer to keep it out of this PR.