From 672d0fd2fd87471b87de20fe0c9bef191692cc15 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Wed, 17 Apr 2024 10:37:01 +0200 Subject: [PATCH 1/3] Add scan filter --- rosbot_bringup/config/laser_filter.yaml | 19 +++++++++++++++++++ rosbot_bringup/launch/bringup.launch.py | 22 ++++++++++++++++++++++ rosbot_bringup/package.xml | 1 + 3 files changed, 42 insertions(+) create mode 100644 rosbot_bringup/config/laser_filter.yaml diff --git a/rosbot_bringup/config/laser_filter.yaml b/rosbot_bringup/config/laser_filter.yaml new file mode 100644 index 00000000..d00d4ea0 --- /dev/null +++ b/rosbot_bringup/config/laser_filter.yaml @@ -0,0 +1,19 @@ +--- +/**/scan_to_scan_filter_chain: + ros__parameters: + filter1: + name: box_filter + type: laser_filters/LaserScanBoxFilter + params: + box_frame: base_link + + max_x: 0.1 + min_x: -0.12 + + max_y: 0.12 + min_y: -0.12 + + max_z: 0.2 + min_z: 0.0 + + invert: false # activate to remove all points outside of the box diff --git a/rosbot_bringup/launch/bringup.launch.py b/rosbot_bringup/launch/bringup.launch.py index 71c70fc9..c72c233a 100644 --- a/rosbot_bringup/launch/bringup.launch.py +++ b/rosbot_bringup/launch/bringup.launch.py @@ -96,6 +96,27 @@ def generate_launch_description(): namespace=namespace, ) + laser_filter_config = PathJoinSubstitution( + [ + rosbot_bringup, + "config", + "laser_filter.yaml", + ] + ) + + laser_filter_node = Node( + package="laser_filters", + executable="scan_to_scan_filter_chain", + parameters=[ + laser_filter_config, + ], + remappings=[ + ("/tf", "tf"), + ("/tf_static", "tf_static"), + ], + namespace=namespace, + ) + actions = [ declare_namespace_arg, declare_mecanum_arg, @@ -105,6 +126,7 @@ def generate_launch_description(): SetParameter(name="use_sim_time", value=use_sim), controller_launch, robot_localization_node, + laser_filter_node, ] return LaunchDescription(actions) diff --git a/rosbot_bringup/package.xml b/rosbot_bringup/package.xml index be9e9742..09f4a6dd 100644 --- a/rosbot_bringup/package.xml +++ b/rosbot_bringup/package.xml @@ -16,6 +16,7 @@ launch launch_ros + laser_filters rosbot_controller robot_localization micro_ros_agent From 8a51d930356d9b269ace0eac7ddb4d6360dad4d8 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Wed, 17 Apr 2024 15:37:59 +0200 Subject: [PATCH 2/3] Clean up --- .github/workflows/tests.yaml | 37 ++++++++++--------------- rosbot_bringup/launch/bringup.launch.py | 12 ++------ 2 files changed, 17 insertions(+), 32 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7f7e84aa..5fb270dc 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -8,27 +8,23 @@ on: jobs: black: name: Black - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Black - uses: psf/black@23.11.0 + - uses: actions/checkout@v3 + - uses: psf/black@stable with: options: --line-length=99 spellcheck: name: Spellcheck - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Spellcheck - uses: rojopolis/spellcheck-github-actions@0.33.1 + - uses: actions/checkout@v3 + - uses: rojopolis/spellcheck-github-actions@0.33.1 industrial_ci: name: Industrial CI - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 30 strategy: fail-fast: false @@ -38,10 +34,6 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Act + Docker fix - run: | - sudo chown runner:docker /var/run/docker.sock - - name: Setup ROS2 Workspace and Clone Repositories run: | mkdir -p src @@ -53,15 +45,16 @@ jobs: cp -r src/ros2_controllers/imu_sensor_broadcaster src/ rm -rf src/ros2_controllers - # Package micro_ros_msgs does not have industrial ci and tests does not pass. - # For more information see https://github.com/micro-ROS/micro_ros_msgs/issues/7 - - name: Remove tests from micro_ros_msgs + - name: Leave only ROSbot tests shell: bash - run: sed '/if(BUILD_TESTING)/,/endif()/d' src/micro_ros_msgs/CMakeLists.txt -i + run: | + sed '/if(BUILD_TESTING)/,/endif()/d' src/diff_drive_controller/CMakeLists.txt -i + sed '/if(BUILD_TESTING)/,/endif()/d' src/imu_sensor_broadcaster/CMakeLists.txt -i + # Package micro_ros_msgs does not have industrial ci and tests does not pass. + # For more information see https://github.com/micro-ROS/micro_ros_msgs/issues/7 + sed '/if(BUILD_TESTING)/,/endif()/d' src/micro_ros_msgs/CMakeLists.txt -i - - name: Running ROS Industrial CI - uses: ros-industrial/industrial_ci@master + - uses: ros-industrial/industrial_ci@master env: ROS_DISTRO: ${{matrix.ROS_DISTRO}} - DOCKER_IMAGE: ros:${{matrix.ROS_DISTRO}}-ros-base IMMEDIATE_TEST_OUTPUT: true diff --git a/rosbot_bringup/launch/bringup.launch.py b/rosbot_bringup/launch/bringup.launch.py index c72c233a..58d71d86 100644 --- a/rosbot_bringup/launch/bringup.launch.py +++ b/rosbot_bringup/launch/bringup.launch.py @@ -96,20 +96,12 @@ def generate_launch_description(): namespace=namespace, ) - laser_filter_config = PathJoinSubstitution( - [ - rosbot_bringup, - "config", - "laser_filter.yaml", - ] - ) + laser_filter_config = PathJoinSubstitution([rosbot_bringup, "config", "laser_filter.yaml"]) laser_filter_node = Node( package="laser_filters", executable="scan_to_scan_filter_chain", - parameters=[ - laser_filter_config, - ], + parameters=[laser_filter_config], remappings=[ ("/tf", "tf"), ("/tf_static", "tf_static"), From d79a8aaa19c1c823b078db70ebe9363b70c08ea5 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Wed, 17 Apr 2024 21:51:24 +0200 Subject: [PATCH 3/3] undo --- .github/workflows/tests.yaml | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5fb270dc..8ae3aa3f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -8,23 +8,27 @@ on: jobs: black: name: Black - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - uses: psf/black@stable + - name: Checkout + uses: actions/checkout@v3 + - name: Black + uses: psf/black@23.11.0 with: options: --line-length=99 spellcheck: name: Spellcheck - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - uses: rojopolis/spellcheck-github-actions@0.33.1 + - name: Checkout + uses: actions/checkout@v3 + - name: Spellcheck + uses: rojopolis/spellcheck-github-actions@0.33.1 industrial_ci: name: Industrial CI - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 timeout-minutes: 30 strategy: fail-fast: false @@ -45,16 +49,15 @@ jobs: cp -r src/ros2_controllers/imu_sensor_broadcaster src/ rm -rf src/ros2_controllers - - name: Leave only ROSbot tests + # Package micro_ros_msgs does not have industrial ci and tests does not pass. + # For more information see https://github.com/micro-ROS/micro_ros_msgs/issues/7 + - name: Remove tests from micro_ros_msgs shell: bash - run: | - sed '/if(BUILD_TESTING)/,/endif()/d' src/diff_drive_controller/CMakeLists.txt -i - sed '/if(BUILD_TESTING)/,/endif()/d' src/imu_sensor_broadcaster/CMakeLists.txt -i - # Package micro_ros_msgs does not have industrial ci and tests does not pass. - # For more information see https://github.com/micro-ROS/micro_ros_msgs/issues/7 - sed '/if(BUILD_TESTING)/,/endif()/d' src/micro_ros_msgs/CMakeLists.txt -i + run: sed '/if(BUILD_TESTING)/,/endif()/d' src/micro_ros_msgs/CMakeLists.txt -i - - uses: ros-industrial/industrial_ci@master + - name: Running ROS Industrial CI + uses: ros-industrial/industrial_ci@master env: ROS_DISTRO: ${{matrix.ROS_DISTRO}} + DOCKER_IMAGE: ros:${{matrix.ROS_DISTRO}}-ros-base IMMEDIATE_TEST_OUTPUT: true