Skip to content

Commit

Permalink
Add scan filter
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed Nov 26, 2024
2 parents da4240f + d79a8aa commit 5425106
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,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
Expand Down
19 changes: 19 additions & 0 deletions rosbot_bringup/config/laser_filter.yaml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions rosbot_bringup/launch/bringup.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,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,
declare_use_sim_arg,
SetParameter(name="use_sim_time", value=use_sim),
controller_launch,
robot_localization_node,
laser_filter_node,
]

return LaunchDescription(actions)
1 change: 1 addition & 0 deletions rosbot_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<exec_depend>launch</exec_depend>
<exec_depend>launch_ros</exec_depend>
<exec_depend>laser_filters</exec_depend>
<exec_depend>rosbot_controller</exec_depend>
<exec_depend>robot_localization</exec_depend>
<exec_depend>micro_ros_agent</exec_depend>
Expand Down

0 comments on commit 5425106

Please sign in to comment.