Skip to content

Commit

Permalink
Run ROS2 build in CI and fix any errors (#32)
Browse files Browse the repository at this point in the history
* Add ROS2 build test

* DO NOT MERGE always run

Signed-off-by: Ryan Friedman <[email protected]>

* Switch to rosdep and vcs

Signed-off-by: Ryan Friedman <[email protected]>

* Run on 22.04 and public runners

Signed-off-by: Ryan Friedman <[email protected]>

* Remove auth since running on public

Signed-off-by: Ryan Friedman <[email protected]>

* debug failing clone

Signed-off-by: Ryan Friedman <[email protected]>

* Run from src directory

Signed-off-by: Ryan Friedman <[email protected]>

* Remove unused ROS 1 packages

Signed-off-by: Ryan Friedman <[email protected]>

* Remove debug on clone

Signed-off-by: Ryan Friedman <[email protected]>

* Fix cmake policy with my fork

Signed-off-by: Ryan Friedman <[email protected]>

* Remove tinyxml dep

Signed-off-by: Ryan Friedman <[email protected]>

* Add workaround for Ubuntu geographiclib packaging bug

Signed-off-by: Ryan Friedman <[email protected]>

* Undo workflow timing

Signed-off-by: Ryan Friedman <[email protected]>

* Fix yamllint errors

Signed-off-by: Ryan Friedman <[email protected]>

* Remove all custom cmake scripts

* Rely on upstream to work properly

Signed-off-by: Ryan Friedman <[email protected]>

* Switch back to upstream mav_comm ros2 branch

Signed-off-by: Ryan Friedman <[email protected]>

---------

Signed-off-by: Ryan Friedman <[email protected]>
Co-authored-by: Jaeyoung-Lim <[email protected]>
  • Loading branch information
Ryanf55 and Jaeyoung-Lim authored Dec 8, 2023
1 parent 3e364f5 commit a43c745
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 92 deletions.
72 changes: 31 additions & 41 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,46 @@
---
name: Build Test
on:
push:
branches:
- 'main'
- 'ros2'
pull_request:
branches:
- '*'
- '*'

jobs:
build:
runs-on: [self-hosted, linux]
runs-on: [ubuntu-22.04]
strategy:
fail-fast: false
matrix:
config:
# - {rosdistro: 'melodic', container: 'px4io/px4-dev-ros-melodic:2021-12-11'}
- {rosdistro: 'noetic', container: 'px4io/px4-dev-ros-noetic:2021-12-11'}
- {rosdistro: 'humble', container: 'osrf/ros:humble-desktop'}
container: ${{ matrix.config.container }}
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dependencies
working-directory:
run: |
apt update
apt install -y python3-wstool libgdal-dev ros-${{matrix.config.rosdistro}}-tf2-geometry-msgs
shell: bash
- name: Build Test
working-directory:
run: |
mkdir -p $HOME/catkin_ws/src;
cd $HOME/catkin_ws
catkin init
catkin config --extend "/opt/ros/${{matrix.config.rosdistro}}"
catkin config --merge-devel
cd $HOME/catkin_ws/src
ln -s $GITHUB_WORKSPACE
cd $HOME/catkin_ws
wstool init src src/terrain-navigation/dependencies.rosinstall
wstool update -t src -j4
rosdep update
rosdep install --from-paths src --ignore-src -y --rosdistro ${{matrix.config.rosdistro}}
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release -DCATKIN_ENABLE_TESTING=False
catkin build -j$(nproc) -l$(nproc) terrain_navigation_ros
- name: unit_tests
working-directory:
run: |
cd $HOME/catkin_ws/src
catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCATKIN_ENABLE_TESTING=True
catkin build terrain_planner --no-deps -i --catkin-make-args tests
source $HOME/catkin_ws/devel/setup.bash
status=0 && for f in $HOME/catkin_ws/devel/lib/*/*-test; do $f || exit 1; done
shell: bash
- uses: actions/checkout@v4
with:
path: src/ethz-asl/terrain-navigation
- name: Check out source dependencies with vcs
run: |
vcs import --recursive --debug --shallow --skip-existing < ethz-asl/terrain-navigation/terrain-navigation.repos
shell: bash
working-directory: src
- name: Install binary dependencies with rosdep
run: |
apt update
rosdep update
source /opt/ros/humble/setup.bash
rosdep install --from-paths src --ignore-src -y --rosdistro ${{matrix.config.rosdistro}}
shell: bash
- name: Build with colcon
run: |
source /opt/ros/humble/setup.bash
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-up-to terrain_navigation_ros
shell: bash
- name: Run tests
run: |
source /opt/ros/humble/setup.bash
colcon test --paths src/ethz-asl/terrain-navigation --event-handlers=console_cohesion+
colcon test-result --all --verbose
shell: bash
2 changes: 0 additions & 2 deletions terrain_navigation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ find_package(grid_map_core REQUIRED)
find_package(grid_map_geo REQUIRED)

find_package(class_loader REQUIRED)
find_package(console_bridge REQUIRED)
find_package(pluginlib REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rosbag2_storage REQUIRED)
find_package(tinyxml2 REQUIRED)
find_package(visualization_msgs REQUIRED)

find_package(action_msgs REQUIRED)
Expand Down
2 changes: 0 additions & 2 deletions terrain_navigation/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@

<!-- <build_depend>rclcpp</build_depend> -->
<build_depend>class_loader</build_depend>
<build_depend>console_bridge</build_depend>
<build_depend>eigen</build_depend>
<build_depend>libgdal-dev</build_depend>
<build_depend>pluginlib</build_depend>
<build_depend>rclcpp</build_depend>
<build_depend>rosbag2_storage</build_depend>
<build_depend>tinyxml2</build_depend>
<build_depend>visualization_msgs</build_depend>

<build_depend>action_msgs</build_depend>
Expand Down
10 changes: 9 additions & 1 deletion terrain_navigation_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
# list(APPEND ${PROJECT_NAME}_CONFIG_EXTRAS
# path/to/file.cmake"
# other/pathto/file.cmake"
Expand Down Expand Up @@ -49,6 +48,15 @@ find_package(visualization_msgs REQUIRED)

find_package(Boost REQUIRED COMPONENTS serialization system filesystem)
find_package(Eigen3 REQUIRED)

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
# Workaround for the supplied find script not being on CMake path in Ubuntu.
# https://bugs.launchpad.net/ubuntu/+source/geographiclib/+bug/1805173
if(IS_DIRECTORY /usr/share/cmake/geographiclib)
list(APPEND CMAKE_MODULE_PATH /usr/share/cmake/geographiclib)
endif()
endif()

find_package(GeographicLib REQUIRED)
# include(CheckGeographicLibDatasets)

Expand Down
27 changes: 0 additions & 27 deletions terrain_navigation_ros/cmake/CheckGeographicLibDatasets.cmake

This file was deleted.

18 changes: 0 additions & 18 deletions terrain_navigation_ros/cmake/_FindGeographicLib.cmake

This file was deleted.

1 change: 0 additions & 1 deletion terrain_navigation_ros/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
<build_depend>tf2_eigen</build_depend>
<build_depend>yaml_cpp_vendor</build_depend>

<exec_depend>dynamic_reconfigure</exec_depend>
<exec_depend>grid_map_visualization</exec_depend>
<exec_depend>grid_map_rviz_plugin</exec_depend>
<exec_depend>mav_planning_rviz</exec_depend>
Expand Down

0 comments on commit a43c745

Please sign in to comment.