Skip to content

Commit a75dee9

Browse files
sambertibus99claude
andcommitted
feat(mapper): add laser line detection with TF lookup and average
- Implement LookUp for faster mapping of laser segments to machines - Add rolling average for corrected TF transformations - Add laser TFs for MPS parts - Fix launch file configuration for mapper node - Add offset configuration parameters - Clean up logging statements Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9069622 commit a75dee9

File tree

9 files changed

+586
-422
lines changed

9 files changed

+586
-422
lines changed

.LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (c) 2024 Carologistics
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,11 @@ qtcreator-*
5151
# Catkin custom files
5252
CATKIN_IGNORE
5353
.vscode/
54+
55+
# Local config files
56+
.config.yaml
57+
.pre-commit-config.yaml
58+
.cmakelint.py
59+
.cmake-format
60+
debug_laser_mapper.rviz
61+
laser_scan_mapper/src/average_calculator.cpp

debug_laser_mapper.rviz

Lines changed: 0 additions & 179 deletions
This file was deleted.

laser_scan_integrator/launch/integrated_scan.launch.py

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2025 Carologistics
2+
# Copyright (c) 2025-2026 Carologistics
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -12,13 +12,18 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15+
import os
16+
17+
from ament_index_python.packages import get_package_share_directory
1518
from launch import LaunchDescription
1619
from launch.actions import DeclareLaunchArgument
1720
from launch.actions import GroupAction
1821
from launch.actions import OpaqueFunction
1922
from launch.conditions import IfCondition
2023
from launch.substitutions import LaunchConfiguration
24+
from launch.substitutions import TextSubstitution
2125
from launch_ros.actions import Node
26+
from launch_ros.parameter_descriptions import ParameterValue
2227

2328

2429
def launch_nodes_withconfig(context, *args, **kwargs):
@@ -42,8 +47,11 @@ def launch_nodes_withconfig(context, *args, **kwargs):
4247

4348
rangeMin = LaunchConfiguration("rangeMin")
4449
rangeMax = LaunchConfiguration("rangeMax")
45-
50+
start_mapper = LaunchConfiguration("start_mapper")
4651
launch_configuration = {}
52+
53+
config_file = os.path.join(get_package_share_directory("laser_scan_mapper"), "config", "offset.yaml")
54+
4755
for argname, argval in context.launch_configurations.items():
4856
launch_configuration[argname] = argval
4957

@@ -86,14 +94,21 @@ def launch_nodes_withconfig(context, *args, **kwargs):
8694
output="screen",
8795
respawn=True,
8896
respawn_delay=2,
89-
condition=IfCondition(LaunchConfiguration("start_mapper")),
97+
condition=IfCondition(start_mapper),
9098
parameters=[
99+
config_file,
91100
{
92101
"frameID": launch_configuration["namespace"],
93-
"position_tolerance": launch_configuration["position_tolerance"],
94-
"angle_tolerance": launch_configuration["angle_tolerance"],
95-
"machine_names": launch_configuration["machine_names"],
96-
}
102+
"position_tolerance": ParameterValue(
103+
LaunchConfiguration("position_tolerance"), value_type=float
104+
),
105+
"angle_tolerance": ParameterValue(LaunchConfiguration("angle_tolerance"), value_type=float),
106+
},
107+
],
108+
arguments=[
109+
"--ros-args",
110+
"-p",
111+
LaunchConfiguration("machine_names"),
97112
],
98113
),
99114
]
@@ -108,11 +123,11 @@ def generate_launch_description():
108123
)
109124
declare_integratedtopic_argument = DeclareLaunchArgument(
110125
"integratedTopic",
111-
default_value="/robotinobase1/scan",
126+
default_value="",
112127
description="Integrated topic to publish the laserscan to",
113128
)
114129
declare_integratedframe_argument = DeclareLaunchArgument(
115-
"integratedFrameId", default_value="robotinobase1/laser_link", description="Integrated Frame ID"
130+
"integratedFrameId", default_value="", description="Integrated Frame ID"
116131
)
117132
declare_scantopic1_argument = DeclareLaunchArgument(
118133
"scanTopic1", default_value="/front/sick_scan/scan", description="Scan topic of the first laserscan"
@@ -152,37 +167,34 @@ def generate_launch_description():
152167
declare_rangeMax_argument = DeclareLaunchArgument("rangeMax", default_value="100.0", description="rangeMax")
153168

154169
declare_start_mapper_argument = DeclareLaunchArgument(
155-
"start_mapper", default_value="false", description='Set this value on "true", to start the mapper node'
170+
"start_mapper", default_value="true", description='Set this value on "true", to start the mapper node'
156171
)
157172
declare_machine_names_argument = DeclareLaunchArgument(
158173
"machine_names",
159174
default_value=[
160-
"M-DS",
161-
"M-SS",
162-
"M-BS",
163-
"M-CS1",
164-
"M-CS2",
165-
"M-RS1",
166-
"M-RS2",
167-
"C-DS",
168-
"C-BS",
169-
"C-SS",
170-
"C-RS1",
171-
"C-RS2",
172-
"C-CS1",
173-
"C-CS2",
175+
TextSubstitution(text="machine_names:="),
176+
TextSubstitution(
177+
text='["M-DS","M-DS-I","M-DS-O","M-SS","M-BS","M-CS1","M-CS2",'
178+
'"M-RS1","M-RS2","C-DS","C-BS","C-SS","C-RS1","C-RS2","C-CS1","C-CS2",'
179+
'"M-SS-I","M-BS-I","M-CS1-I","M-CS2-I","M-RS1-I","M-RS2-I",'
180+
'"C-DS-I","C-BS-I","C-SS-I","C-RS1-I","C-RS2-I","C-CS1-I","C-CS2-I",'
181+
'"M-SS-O","M-BS-O","M-CS1-O","M-CS2-O","M-RS1-O","M-RS2-O",'
182+
'"C-DS-O","C-BS-O","C-SS-O","C-RS1-O","C-RS2-O","C-CS1-O","C-CS2-O"]'
183+
),
174184
],
175185
description="List of machine frame IDs used by the mapper node to retrieve their static transforms (TFs).",
176186
)
177187
declare_position_tolerance_argument = DeclareLaunchArgument(
178188
"position_tolerance",
179-
default_value="0.3",
180-
description="Maximum allowed distance (in meters) between a laser segment and a machine for association.",
189+
default_value="1",
190+
description="Maximum allowed distance (in meters) between the callculated machine mid point based on the laser segment "
191+
" and a the machine frame from the refbox",
181192
)
182193
declare_angle_tolerance_argument = DeclareLaunchArgument(
183194
"angle_tolerance",
184-
default_value="0.5",
185-
description="Maximum allowed angular deviation (in radians) between a laser segment and a machine orientation.",
195+
default_value="3.14",
196+
description="Maximum allowed angular deviation (in radians) between the callculated machine mid point based on the laser segment"
197+
" and a the machine frame from the refbox",
186198
)
187199

188200
# Erstellen des LaunchDescription-Objekts und Hinzufügen der Aktionen

laser_scan_integrator/launch/visualize_integrated_scan.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2025 Carologistics
1+
# Copyright (c) 2025-2026 Carologistics
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)