update: implement laser filter

This commit is contained in:
Björn Ellensohn 2023-10-13 09:56:09 +02:00
parent 224924ca64
commit b58f81845b
3 changed files with 39 additions and 0 deletions

15
config/box_filter.yaml Normal file
View File

@ -0,0 +1,15 @@
scan_to_scan_filter_chain:
ros__parameters:
filter1:
name: box_filter
type: laser_filters/LaserScanBoxFilter
params:
box_frame: laser_frame
max_x: 0.16
max_y: 0.16
max_z: 0.1
min_x: -0.41
min_y: -0.16
min_z: -0.2
invert: false # activate to remove all points outside of the box

View File

@ -8,6 +8,7 @@ from launch.actions import DeclareLaunchArgument
from launch.actions import LogInfo from launch.actions import LogInfo
from launch.substitutions import LaunchConfiguration from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node from launch_ros.actions import Node
from launch.substitutions import ThisLaunchFileDir
def generate_launch_description(): def generate_launch_description():
channel_type = LaunchConfiguration('channel_type', default='serial') channel_type = LaunchConfiguration('channel_type', default='serial')
@ -68,4 +69,9 @@ def generate_launch_description():
}], }],
#namespace = "/rmp" #namespace = "/rmp"
) )
IncludeLaunchDescription(
PythonLaunchDescriptionSource([ThisLaunchFileDir(), 'robot_scan_filter.launch.py']),
#launch_arguments={'my_arg': 'new_value'}.items() # You can pass arguments here
),
]) ])

View File

@ -0,0 +1,18 @@
from launch import LaunchDescription
from launch.substitutions import PathJoinSubstitution
from launch_ros.actions import Node
from ament_index_python.packages import get_package_share_directory
def generate_launch_description():
return LaunchDescription([
Node(
package="laser_filters",
executable="scan_to_scan_filter_chain",
parameters=[
PathJoinSubstitution([
get_package_share_directory("cps_rmp220_support"),
"config", "box_filter.yaml",
])],
)
])