From f50a01de83be8860b3dcd8b9066af18caff486af Mon Sep 17 00:00:00 2001 From: Jake McLaughlin Date: Wed, 15 May 2024 14:51:36 -0400 Subject: [PATCH] Cast nullptr to type for manifold support --- .../test/test_unicycle_2d_state_cost_function.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fuse_models/test/test_unicycle_2d_state_cost_function.cpp b/fuse_models/test/test_unicycle_2d_state_cost_function.cpp index e7b1a9afd..650d7e171 100644 --- a/fuse_models/test/test_unicycle_2d_state_cost_function.cpp +++ b/fuse_models/test/test_unicycle_2d_state_cost_function.cpp @@ -99,7 +99,17 @@ TEST(CostFunction, evaluateCostFunction) // Check jacobians are correct using a gradient checker ceres::NumericDiffOptions numeric_diff_options; - ceres::GradientChecker gradient_checker(&cost_function, nullptr, numeric_diff_options); +#if !CERES_SUPPORTS_MANIFOLDS + ceres::GradientChecker gradient_checker( + &cost_function, + static_cast*>(nullptr), + numeric_diff_options); +#else + ceres::GradientChecker gradient_checker( + &cost_function, + static_cast*>(nullptr), + numeric_diff_options); +#endif // We cannot use std::numeric_limits::epsilon() tolerance because the worst relative error is 5.26356e-10 ceres::GradientChecker::ProbeResults probe_results;