Skip to content
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

Add support for rolling release #287

Open
wants to merge 15 commits into
base: ros2
Choose a base branch
from
52 changes: 52 additions & 0 deletions .github/workflows/ci_action_rolling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI-Rolling

on: [push, pull_request]

env:
ROS_DISTRO: rolling

jobs:
testing-repo:
name: "Build + Test with Testing Repo of rolling (http://packages.ros.org/ros2-testing/ubuntu)"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: 'ros-industrial/industrial_ci@master'
env:
ROS_REPO: testing

main-repo:
name: "Build + Test with Main Repo of rolling (http://packages.ros.org/ros2/ubuntu)"
runs-on: ubuntu-20.04
continue-on-error: true
steps:
- uses: actions/checkout@v1
- uses: 'ros-industrial/industrial_ci@master'
env:
ROS_REPO: main

# ToDo: fix headers
# clang-tidy:
# name: "Run clang-tidy check with Testing Repo of rolling (http://packages.ros.org/ros2-testing/ubuntu)"
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v1
# - uses: 'ros-industrial/industrial_ci@master'
# env:
# ROS_REPO: testing
# CLANG_TIDY: true
# NOT_TEST_BUILD: true

coverage:
name: "Run coverage check with Testing Repo of rolling (http://packages.ros.org/ros2-testing/ubuntu)"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: 'ros-industrial/industrial_ci@master'
env:
ROS_REPO: testing
ADDITIONAL_DEBS: git lcov
PARALLEL_TESTS: false
CMAKE_ARGS: '-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="--coverage"'
DOCKER_RUN_OPTS: '-e COVERAGE_EXCLUDES="*/psen_scan_v2/src/psen_scan_driver.cpp"'
AFTER_SCRIPT: 'git clone --depth=1 --branch master https://github.com/PilzDE/industrial_ci_addons.git /industrial_ci_addons && source /industrial_ci_addons/check_coverage.sh && check_coverage psen_scan_v2'
52 changes: 52 additions & 0 deletions .github/workflows/ci_action_rolling_binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI-Rolling Binary Test

on: [push, pull_request]

jobs:
debian:
name: "Create debian binary for psen_scan_v2"
runs-on: ubuntu-20.04
container: ros:rolling-ros-core
steps:
- uses: actions/checkout@v1

- name: Initialize ROS environment
run: |
apt-get update && apt install python3-bloom fakeroot dpkg-dev debhelper -y
rosdep init && rosdep update
rosdep install --from-paths . -r -y

- name: Generate debian binary
run: |
source /opt/ros/rolling/setup.bash
bloom-generate rosdebian --ros-distro rolling
fakeroot debian/rules binary
cp ../ros-rolling-psen-scan-v2_*.deb cached-rolling-binary.deb
shell: bash

- uses: actions/cache@v2
with:
key: debian-${{ github.sha }}
path: cached-rolling-binary.deb

launch-check:
name: "Launch check for psen_scan_v2"
needs: debian
runs-on: ubuntu-20.04
container: ros:rolling-ros-core
steps:
- uses: actions/cache@v2
with:
key: debian-${{ github.sha }}
path: cached-rolling-binary.deb

- name: Install debian
run: apt-get update && apt-get install -y ros-rolling-ros-testing ./cached-rolling-binary.deb

- uses: actions/checkout@v1

- name: Launch test
run: |
source /opt/ros/rolling/setup.bash
ros2 test test/integration_tests/integrationtest_ros_scanner_launch.launch.py
shell: bash
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ target_include_directories(${PROJECT_NAME}_node
)
target_link_libraries(${PROJECT_NAME}_node
${PROJECT_NAME}_standalone
fmt::fmt
)
ament_target_dependencies(${PROJECT_NAME}_node
rclcpp
Expand Down Expand Up @@ -416,7 +417,11 @@ if(BUILD_TESTING)

# This test is intended to be run on in a dedicated environment with a prerecorded reference scan
# and thus needs to be enabled seperately.
find_package(rosbag2_cpp REQUIRED)
find_package(rosbag2_cpp 0.4.0)
if(NOT rosbag2_cpp_FOUND)
find_package(rosbag2_cpp)
add_compile_definitions(ROSBAG2_VERSION_PRE_0_4)
endif()
if(ENABLE_HARDWARE_TESTING_WITH_REFERENCE_SCAN)

ament_add_gtest(hwtest_scan_compare_standalone
Expand Down
1 change: 0 additions & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<test_depend>python3-pytest</test_depend>
<test_depend>rclpy</test_depend>
<test_depend>rosbag2_cpp</test_depend>
<test_depend>rosbag2_storage_default_plugins</test_depend>

<test_depend>libconsole-bridge-dev</test_depend>

Expand Down
2 changes: 1 addition & 1 deletion test/hw_tests/hwtest_scan_compare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ScanComparisonTests : public ::testing::Test
void SetUp() override // Omit using SetUpTestSuite() for googletest below v1.11.0, see
// https://github.com/google/googletest/issues/247
{
node_ptr_->declare_parameter(TEST_DURATION_PARAM_NAME);
node_ptr_->declare_parameter(TEST_DURATION_PARAM_NAME, 60);
rclcpp::Parameter test_duration_param = node_ptr_->get_parameter(TEST_DURATION_PARAM_NAME);
try
{
Expand Down
4 changes: 4 additions & 0 deletions test/include/psen_scan_v2/laserscan_validator.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ std::map<int16_t, NormalDist> binsFromRosbag(std::string path)
std::map<int16_t, NormalDist> bins;

// the following could be simplified if https://github.com/ros2/rosbag2/pull/452 would be released to foxy
#ifdef ROSBAG2_VERSION_PRE_0_4 // old api
rosbag2_cpp::StorageOptions storage_options;
#else
rosbag2_storage::StorageOptions storage_options;
#endif
storage_options.uri = path;
storage_options.storage_id = "sqlite3";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def generate_test_description():
PathJoinSubstitution([
get_package_share_directory('psen_scan_v2'),
'launch',
'psen_scan_v2.launch.xml'
'bringup.launch.xml'
])
)

Expand Down Expand Up @@ -72,9 +72,6 @@ def isNodeAvailable(self, node_name: str, timeout: float) -> bool:
def test_psen_scan_v2_node_available(self):
self.assertTrue(self.isNodeAvailable('laser_1', 10.0))

def test_robot_state_publisher_node_available(self):
self.assertTrue(self.isNodeAvailable('robot_state_publisher', 10.0))


@launch_testing.post_shutdown_test()
class TestOutcome(unittest.TestCase):
Expand Down