Skip to content

Commit

Permalink
Merge branch 'master' into ros-o
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada authored Dec 9, 2024
2 parents 18506fa + 0f775b0 commit bbbdecf
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 3 deletions.
79 changes: 78 additions & 1 deletion .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ jobs:
BEFORE_SCRIPT : "find $GITHUB_WORKSPACE -iname image_view2 -exec touch {}/CATKIN_IGNORE \\;"


container: ${{ matrix.CONTAINER }}
container:
image: ${{ matrix.CONTAINER }}
volumes:
- /tmp/node20:/__e/node20

steps:
- name: Install latest git ( use sudo for ros-ubuntu )
run: |
Expand All @@ -63,6 +67,21 @@ jobs:
git config --global --add safe.directory $GITHUB_WORKSPACE
fi
- name: Try to replace `node` with an glibc 2.17
shell: bash
run: |
if [ "${{ matrix.CONTAINER }}" = "jskrobotics/ros-ubuntu:14.04" ]; then
export USER=$(whoami)
sudo chmod 777 -R /__e/node20
sudo chown -R $USER /__e/node20
fi
ls -lar /__e/node20 &&
sudo apt-get install -y curl &&
curl -Lo /tmp/node.tar.gz https://unofficial-builds.nodejs.org/download/release/v20.17.0/node-v20.17.0-linux-x64-glibc-217.tar.gz &&
cd /__e/node20 &&
tar -x --strip-components=1 -f /tmp/node.tar.gz &&
ls -lar /__e/node20/bin/
- name: Chcekout
uses: actions/[email protected]

Expand Down Expand Up @@ -170,3 +189,61 @@ jobs:
source ~/ws_depend/devel_isolated/setup.bash
catkin_make_isolated ${{ matrix.CATKIN_OPTIONS }} --cmake-args -DCATKIN_ENABLE_TESTING=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ${{ matrix.CMAKE_OPTIONS }}
shell: bash

# ROS-O setup https://github.com/v4hn/ros-o-builder/blob/jammy-one/README.md#install-instructions
ros-o:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- DISTRO: ubuntu:22.04
ROS_REPOSITORY_URL: https://raw.githubusercontent.com/v4hn/ros-o-builder/jammy-one/repository

container: ${{ matrix.DISTRO }}

env:
DEBIAN_FRONTEND : noninteractive

steps:
- name: Chcekout Source
uses: actions/[email protected]

- name: Setup ROS-O deb repository
run: |
set -x
apt update && apt install -qq -y ca-certificates
echo "deb [trusted=yes] ${{ matrix.ROS_REPOSITORY_URL }}/ ./" | tee /etc/apt/sources.list.d/ros-o-builder.list
apt update
apt install -qq -y python3-rosdep2
echo "yaml ${{ matrix.ROS_REPOSITORY_URL }}/local.yaml debian" | tee /etc/ros/rosdep/sources.list.d/1-ros-o-builder.list
rosdep update
- name: Setup catkin-tools
run: |
set -x
# setup catkin tools
apt install -qq -y python3-pip
pip3 install catkin-tools
# setup build tools
apt install -qq -y cmake build-essential catkin ros-one-rosbash
- name: Setup Workspace
run: |
source /opt/ros/one/setup.bash
set -x
# setup workspace
mkdir -p ~/ws/src
cd ~/ws/src
ln -sf $GITHUB_WORKSPACE .
rosdep install -qq -r -y --from-path . --ignore-src || echo "OK"
shell: bash

- name: Compile Packages
run: |
source /opt/ros/one/setup.bash
set -x
cd ~/ws/
catkin build --no-status -sv ${{ matrix.CATKIN_OPTIONS }} --cmake-args -DCATKIN_ENABLE_TESTING=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ${{ matrix.CMAKE_OPTIONS }}
shell: bash
20 changes: 19 additions & 1 deletion jsk_data/src/jsk_data/download_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,21 @@ def _get_package_source_path(pkg_name):
return pkg_path


def _get_colcon_package_share_path(pkg_name):
"""
Return package share path when colcon build.
NOTE: The install/share or install/$pkg_name/share/$pkg_name directories is not created
until colcon build finished. So this functions returns the path whether the directory
is exists or not.
"""
current_colcon_prefix_path = os.getenv("COLCON_PREFIX_PATH").split(":")[0]
if os.path.exists(os.path.join(current_colcon_prefix_path, "share")): # if merge install
share_path = os.path.join(current_colcon_prefix_path, "share", pkg_name)
else: # if default install
share_path = os.path.join(current_colcon_prefix_path, pkg_name, "share", pkg_name)
return share_path


def download_data(pkg_name, path, url, md5, download_client=None,
extract=False, compressed_bags=None, quiet=True, chmod=True,
n_times=2):
Expand All @@ -172,7 +187,10 @@ def download_data(pkg_name, path, url, md5, download_client=None,
if compressed_bags is None:
compressed_bags = []
if not osp.isabs(path):
pkg_path = _get_package_source_path(pkg_name)
if os.getenv("COLCON_PREFIX_PATH"):
pkg_path = _get_colcon_package_share_path(pkg_name)
else:
pkg_path = _get_package_source_path(pkg_name)
if not pkg_path:
print('\033[31mPackage [%s] is not found in current workspace. Skipping download\033[0m' % pkg_name,
file=sys.stderr)
Expand Down
2 changes: 1 addition & 1 deletion jsk_rosbag_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ catkin_package(
CATKIN_DEPENDS
)

if("$ENV{ROS_DISTRO}" STRGREATER "noetic" OR "$ENV{ROS_DISTRO}" STREQUAL "Debian")
if(("$ENV{ROS_DISTRO}" STREQUAL "noetic") OR ("$ENV{ROS_DISTRO}" STREQUAL "Debian") OR ("$ENV{ROS_DISTRO}" STREQUAL "debian"))
catkin_generate_virtualenv(
INPUT_REQUIREMENTS requirements.in
PYTHON_INTERPRETER python3
Expand Down
Empty file added parallel_util/COLCON_IGNORE
Empty file.

0 comments on commit bbbdecf

Please sign in to comment.