Skip to content

Commit

Permalink
Modified laser_filtered
Browse files Browse the repository at this point in the history
  • Loading branch information
avalen2022 committed Mar 5, 2024
1 parent 0a8c99f commit a0fae3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
10 changes: 7 additions & 3 deletions config/footprint_filter.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
scan_to_scan_filter_chain:
ros__parameters:
filter1:
name: footprint_filter
type: laser_filters/LaserScanFootprintFilter
name: box_filter
type: laser_filters/LaserScanRangeFilter
params:
inscribed_radius: 0.325
use_message_range_limits: false # if not specified defaults to false
lower_threshold: 0.325 # if not specified defaults to 0.0
upper_threshold: 20.0 # if not specified defaults to 100000.0
lower_replacement_value: .inf # if not specified defaults to NaN
upper_replacement_value: .inf # if not specified defaults to NaN
19 changes: 5 additions & 14 deletions launch/kobuki.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def generate_launch_description():
package_dir = get_package_share_directory('kobuki')

params_file = os.path.join(package_dir, 'config', 'kobuki_node_params.yaml')
params_file_filter = os.path.join(package_dir, 'config', 'footprint_filter.yaml')
with open(params_file, 'r') as f:
kobuki_params = yaml.safe_load(f)['kobuki_ros_node']['ros__parameters']

Expand Down Expand Up @@ -145,33 +146,23 @@ def generate_launch_description():
laser_filter_cmd = Node(
package='laser_filters',
executable='scan_to_scan_filter_chain',
parameters=[
PathJoinSubstitution([
package_dir,
'params', 'footprint_filter.yaml',
])
],
parameters=[params_file_filter],
condition=IfCondition(PythonExpression([lidar]))
)

laser_filter_s2_cmd = Node(
package='laser_filters',
executable='scan_to_scan_filter_chain',
parameters=[
PathJoinSubstitution([
package_dir,
'params', 'footprint_filter.yaml',
])
],
parameters=[params_file_filter],
condition=IfCondition(PythonExpression([lidar_s2]))
)

ld.add_action(declare_lidar_cmd)
ld.add_action(rplidar_cmd)
ld.add_action(declare_lidar_s2_cmd)
ld.add_action(rplidar__s2_cmd)
# ld.add_action(rplidar__s2_cmd)
ld.add_action(laser_filter_cmd)
ld.add_action(laser_filter_s2_cmd)
# ld.add_action(laser_filter_s2_cmd)

tf_footprint2base_cmd = Node(
package='tf2_ros',
Expand Down

0 comments on commit a0fae3d

Please sign in to comment.