Skip to content

Commit

Permalink
Expose number of icp iterations in ros (#292)
Browse files Browse the repository at this point in the history
* Expose registration params to ROS node

* More merge conflicts

* Default to multithread
  • Loading branch information
nachovizzo authored Mar 18, 2024
1 parent b413934 commit 916d84d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ros/launch/odometry.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ class config:
initial_threshold: float = 2.0
min_motion_th: float = 0.1

# Registration
max_num_iterations: int = 500 #
convergence_criterion: float = 0.0001
max_num_threads: int = 0

# Covariance diagonal values
position_covariance: float = 0.1
orientation_covariance: float = 0.1
Expand Down Expand Up @@ -90,8 +95,14 @@ def generate_launch_description():
"deskew": config.deskew,
"max_points_per_voxel": config.max_points_per_voxel,
"voxel_size": config.voxel_size,
# Adaptive threshold
"initial_threshold": config.initial_threshold,
"min_motion_th": config.min_motion_th,
# Registration
"max_num_iterations": config.max_num_iterations,
"convergence_criterion": config.convergence_criterion,
"max_num_threads": config.max_num_threads,
# Fixed covariances
"position_covariance": config.position_covariance,
"orientation_covariance": config.orientation_covariance,
# ROS CLI arguments
Expand Down
5 changes: 5 additions & 0 deletions ros/src/OdometryServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ OdometryServer::OdometryServer(const rclcpp::NodeOptions &options)
config.initial_threshold =
declare_parameter<double>("initial_threshold", config.initial_threshold);
config.min_motion_th = declare_parameter<double>("min_motion_th", config.min_motion_th);
config.max_num_iterations =
declare_parameter<int>("max_num_iterations", config.max_num_iterations);
config.convergence_criterion =
declare_parameter<double>("convergence_criterion", config.convergence_criterion);
config.max_num_threads = declare_parameter<int>("max_num_threads", config.max_num_threads);
if (config.max_range < config.min_range) {
RCLCPP_WARN(get_logger(),
"[WARNING] max_range is smaller than min_range, settng min_range to 0.0");
Expand Down

0 comments on commit 916d84d

Please sign in to comment.