Skip to content

Commit

Permalink
Fix to make sure that ROS2 can find the iCub package (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored and mebbaid committed Dec 1, 2022
1 parent bbdbbbd commit f547a99
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/cxx-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ jobs:
run: |
# Workaround for https://github.com/conda-incubator/setup-miniconda/issues/186
conda config --remove channels defaults
# Compilation related dependencies
mamba install cmake compilers make ninja pkg-config python
# Build and test dependencies (ROS packages to test that resouces are find correctly by ROS/ROS2)
# ros-noetic-catkin is required otherwised ROS_PACKAGE_PATH is not defined and rospack list does not return anything
mamba install -c conda-forge -c robostack -c robostack-humble cmake compilers make ninja pkg-config python ros-noetic-rospack ros-noetic-catkin ros-humble-ros2pkg
- name: Print used environment [Conda]
shell: bash -l {0}
Expand Down Expand Up @@ -63,6 +64,28 @@ jobs:
cd build
cmake --build . --config ${{ matrix.build_type }}
- name: Install [Conda]
shell: bash -l {0}
run: |
cd build
cmake --install . --config ${{ matrix.build_type }}
- name: Test ROS Package can be found [Conda/Linux&macOS]
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
# Test ROS
rospack find iCub
# Test ROS2
ros2 pkg prefix iCub
- name: Test ROS Package can be found [Conda/Windows]
if: contains(matrix.os, 'windows')
shell: cmd /C CALL {0}
run: |
rospack find iCub
ros2 pkg prefix iCub
build-with-system-dependencies:
name: '[${{ matrix.os }}@${{ matrix.build_type }}]'
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format of this document is based on [Keep a Changelog](https://keepachangelo

## [Unreleased]

### Fixed
* Fix finding the `iCub` package in ROS2 (https://github.com/robotology/icub-models/pull/178).

## [1.25.0] - 2022-08-23

### Changed
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ string(REPLACE ";" "," INSTALLED_URDF_MODELS "${INSTALLED_URDF_MODELS}")
# Install the whole iCub directory
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/iCub DESTINATION share)

# Install empty iCub file in <prefix>/share/ament_index/resource_index/packages
# so that iCub packages if found by ROS2
# See https://github.com/robotology/icub-models/issues/177
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/iCub_empty_file "")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iCub_empty_file
DESTINATION share/ament_index/resource_index/packages
RENAME iCub)

add_subdirectory(cpp)
add_subdirectory(python)

Expand Down

0 comments on commit f547a99

Please sign in to comment.