Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix (#809): check if covariance values are specified or not #810

Merged
merged 1 commit into from
Jun 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/ros_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1857,16 +1857,20 @@ void RosFilter<T>::loadParams()
RCLCPP_FATAL_STREAM(get_logger(), error);
throw std::invalid_argument(error);
}
return true;
}
return false;
};

load_covariance("process_noise_covariance", process_noise_covariance_);
RF_DEBUG("Process noise covariance is:\n" << process_noise_covariance_ << "\n");
filter_.setProcessNoiseCovariance(process_noise_covariance_);
if (load_covariance("process_noise_covariance", process_noise_covariance_)) {
RF_DEBUG("Process noise covariance is:\n" << process_noise_covariance_ << "\n");
filter_.setProcessNoiseCovariance(process_noise_covariance_);
}

load_covariance("initial_estimate_covariance", initial_estimate_error_covariance_);
RF_DEBUG("Initial estimate covariance is:\n" << initial_estimate_error_covariance_ << "\n");
filter_.setEstimateErrorCovariance(initial_estimate_error_covariance_);
if (load_covariance("initial_estimate_covariance", initial_estimate_error_covariance_)) {
RF_DEBUG("Initial estimate covariance is:\n" << initial_estimate_error_covariance_ << "\n");
filter_.setEstimateErrorCovariance(initial_estimate_error_covariance_);
}
}

template<typename T>
Expand Down