Skip to content

Commit

Permalink
feat: read LiDAR calibration params from file
Browse files Browse the repository at this point in the history
  • Loading branch information
TomohitoAndo committed Oct 2, 2024
1 parent 3a457bd commit 09cae00
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
4 changes: 2 additions & 2 deletions aip_x2_gen2_launch/launch/hesai_OT128.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<arg name="is_channel_order_top2down" default="true"/>
<arg name="horizontal_resolution" default="0.4"/>
<arg name="enable_blockage_diag" default="$(var enable_blockage_diag)"/>
<arg name="calibration" default="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_lower.csv" />
<arg name="calibration_file" default="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_lower.csv" />
<arg name="dual_return_filter_param_file" default="$(var dual_return_filter_param_file)" />
<arg name="vehicle_mirror_param_file" default="$(var vehicle_mirror_param_file)" />
<arg name="blockage_diagnostics_param_file" default="$(find-pkg-share aip_x2_gen2_launch)/config/blockage_diagnostics_param_file.yaml" />
Expand Down Expand Up @@ -61,7 +61,7 @@
<arg name="is_channel_order_top2down" value="$(var is_channel_order_top2down)"/>
<arg name="horizontal_resolution" value="$(var horizontal_resolution)"/>
<arg name="enable_blockage_diag" value="$(var enable_blockage_diag)"/>
<arg name="calibration" value="$(var calibration)"/>
<arg name="calibration_file" value="$(var calibration_file)"/>
<arg name="dual_return_filter_param_file" value="$(var dual_return_filter_param_file)"/>
<arg name="blockage_diagnostics_param_file" value="$(var blockage_diagnostics_param_file)"/>

Expand Down
4 changes: 2 additions & 2 deletions aip_x2_gen2_launch/launch/hesai_QT128.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<arg name="is_channel_order_top2down" default="true"/>
<arg name="horizontal_resolution" default="0.4"/>
<arg name="enable_blockage_diag" default="$(var enable_blockage_diag)"/>
<arg name="calibration" default="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_lower.csv" />
<arg name="calibration_file" default="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_lower.csv" />
<arg name="dual_return_filter_param_file" default="$(var dual_return_filter_param_file)" />
<arg name="vehicle_mirror_param_file" default="$(var vehicle_mirror_param_file)" />
<arg name="blockage_diagnostics_param_file" default="$(find-pkg-share aip_x2_gen2_launch)/config/blockage_diagnostics_param_file.yaml" />
Expand Down Expand Up @@ -61,7 +61,7 @@
<arg name="is_channel_order_top2down" value="$(var is_channel_order_top2down)"/>
<arg name="horizontal_resolution" value="$(var horizontal_resolution)"/>
<arg name="enable_blockage_diag" value="$(var enable_blockage_diag)"/>
<arg name="calibration" value="$(var calibration)"/>
<arg name="calibration_file" value="$(var calibration_file)"/>
<arg name="dual_return_filter_param_file" value="$(var dual_return_filter_param_file)"/>
<arg name="blockage_diagnostics_param_file" value="$(var blockage_diagnostics_param_file)"/>
</include>
Expand Down
16 changes: 8 additions & 8 deletions aip_x2_gen2_launch/launch/lidar.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<arg name="is_channel_order_top2down" value="true"/>
<arg name="horizontal_resolution" value="0.4"/>
<arg name="enable_blockage_diag" value="$(var enable_blockage_diag)"/>
<arg name="calibration" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_lower.csv" />
<arg name="calibration_file" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/rear_upper.csv" />
<arg name="dual_return_filter_param_file" value="$(var dual_return_filter_param_file)" />
</include>
</group>
Expand Down Expand Up @@ -86,7 +86,7 @@
<arg name="is_channel_order_top2down" value="true"/>
<arg name="horizontal_resolution" value="0.4"/>
<arg name="enable_blockage_diag" value="$(var enable_blockage_diag)"/>
<arg name="calibration" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_lower.csv" />
<arg name="calibration_file" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/left_upper.csv" />
<arg name="dual_return_filter_param_file" value="$(var dual_return_filter_param_file)" />
</include>
</group>
Expand Down Expand Up @@ -119,7 +119,7 @@
<arg name="is_channel_order_top2down" value="true"/>
<arg name="horizontal_resolution" value="0.4"/>
<arg name="enable_blockage_diag" value="$(var enable_blockage_diag)"/>
<arg name="calibration" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_lower.csv" />
<arg name="calibration_file" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/rear_lower.csv" />
<arg name="dual_return_filter_param_file" value="$(var dual_return_filter_param_file)" />
</include>
</group>
Expand Down Expand Up @@ -152,7 +152,7 @@
<arg name="is_channel_order_top2down" value="true"/>
<arg name="horizontal_resolution" value="0.4"/>
<arg name="enable_blockage_diag" value="$(var enable_blockage_diag)"/>
<arg name="calibration" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_lower.csv" />
<arg name="calibration_file" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/left_lower.csv" />
<arg name="dual_return_filter_param_file" value="$(var dual_return_filter_param_file)" />
</include>
</group>
Expand Down Expand Up @@ -186,7 +186,7 @@
<arg name="is_channel_order_top2down" value="true"/>
<arg name="horizontal_resolution" value="0.4"/>
<arg name="enable_blockage_diag" value="$(var enable_blockage_diag)"/>
<arg name="calibration" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_lower.csv" />
<arg name="calibration_file" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_upper.csv" />
<arg name="dual_return_filter_param_file" value="$(var dual_return_filter_param_file)" />
</include>
</group>
Expand Down Expand Up @@ -219,7 +219,7 @@
<arg name="is_channel_order_top2down" value="true"/>
<arg name="horizontal_resolution" value="0.4"/>
<arg name="enable_blockage_diag" value="$(var enable_blockage_diag)"/>
<arg name="calibration" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_lower.csv" />
<arg name="calibration_file" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/right_upper.csv" />
<arg name="dual_return_filter_param_file" value="$(var dual_return_filter_param_file)" />
</include>
</group>
Expand Down Expand Up @@ -252,7 +252,7 @@
<arg name="is_channel_order_top2down" value="true"/>
<arg name="horizontal_resolution" value="0.4"/>
<arg name="enable_blockage_diag" value="$(var enable_blockage_diag)"/>
<arg name="calibration" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_lower.csv" />
<arg name="calibration_file" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_lower.csv" />
<arg name="dual_return_filter_param_file" value="$(var dual_return_filter_param_file)" />
</include>
</group>
Expand Down Expand Up @@ -285,7 +285,7 @@
<arg name="is_channel_order_top2down" value="true"/>
<arg name="horizontal_resolution" value="0.4"/>
<arg name="enable_blockage_diag" value="$(var enable_blockage_diag)"/>
<arg name="calibration" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/front_lower.csv" />
<arg name="calibration_file" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2_gen2/pandar/right_lower.csv" />
<arg name="dual_return_filter_param_file" value="$(var dual_return_filter_param_file)" />
</include>
</group>
Expand Down
15 changes: 3 additions & 12 deletions aip_x2_gen2_launch/launch/nebula_node_container.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,6 @@ def str2vector(string):
sensor_make, sensor_extension = get_lidar_make(sensor_model)
nebula_decoders_share_dir = get_package_share_directory("nebula_decoders")

# Calibration file
sensor_calib_fp = os.path.join(
nebula_decoders_share_dir,
"calibration",
sensor_make.lower(),
sensor_model + sensor_extension,
)
assert os.path.exists(
sensor_calib_fp
), "Sensor calib file under calibration/ was not found: {}".format(sensor_calib_fp)

glog_component = ComposableNode(
package="glog_component",
plugin="GlogComponent",
Expand All @@ -108,7 +97,6 @@ def str2vector(string):
name=sensor_make.lower() + "_ros_wrapper_node",
parameters=[
{
"calibration_file": sensor_calib_fp,
"sensor_model": sensor_model,
"point_filters": "{}",
**create_parameter_dict(
Expand All @@ -134,6 +122,7 @@ def str2vector(string):
"ptp_switch_type",
"ptp_domain",
"diag_span",
"calibration_file",
),
"launch_hw": True,
"retry_hw": True,
Expand Down Expand Up @@ -383,6 +372,8 @@ def add_launch_arg(name: str, default_value=None, description=None):
add_launch_arg("max_azimuth_deg", "225.0")
add_launch_arg("enable_blockage_diag", "true")

add_launch_arg("calibration_file", "")

set_container_executable = SetLaunchConfiguration(
"container_executable",
"component_container",
Expand Down

0 comments on commit 09cae00

Please sign in to comment.