diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index adf4a121..4b9dc9cd 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -32,9 +32,14 @@ jobs: # https://ros.org/reps/rep-2000.html include: # Noetic Ninjemys (May 2020 - May 2025) + # - docker_image: ubuntu:focal + # ros_distribution: noetic + # ros_version: 1 + + # Foxy Fitzroy (May 2020 - May 2023) - docker_image: ubuntu:focal - ros_distribution: noetic - ros_version: 1 + ros_distribution: foxy + ros_version: 2 # Humble Hawksbill (May 2022 - May 2027) - docker_image: ubuntu:jammy diff --git a/vortex-filtering/test/dynamic_model_test.cpp b/vortex-filtering/test/dynamic_model_test.cpp index d8741487..2a71c498 100644 --- a/vortex-filtering/test/dynamic_model_test.cpp +++ b/vortex-filtering/test/dynamic_model_test.cpp @@ -51,8 +51,8 @@ TEST(DynamicModel, sampleSimpleModel) EXPECT_TRUE(isApproxEqual(approx_gauss.mean(), true_gauss.mean(), 0.1)); EXPECT_TRUE(isApproxEqual(true_gauss.cov(), true_gauss.cov(), 0.1)); + #ifdef GNUPLOT_ENABLE // Plot - Gnuplot gp; gp << "set xrange [-10:10]\nset yrange [-10:10]\n"; gp << "set style circle radius 0.05\n"; @@ -63,6 +63,7 @@ TEST(DynamicModel, sampleSimpleModel) gp << "set object 1 ellipse center " << cov_ellipse.x() << "," << cov_ellipse.y() << " size " << 3 * cov_ellipse.a() << "," << 3 * cov_ellipse.b() << " angle " << cov_ellipse.angle_deg() << "fs empty border lc rgb 'cyan'\n"; gp << "replot\n"; + #endif } } // namespace simple_dynamic_model_test diff --git a/vortex-filtering/test/ekf_test.cpp b/vortex-filtering/test/ekf_test.cpp index a6c013b1..5b04eb41 100644 --- a/vortex-filtering/test/ekf_test.cpp +++ b/vortex-filtering/test/ekf_test.cpp @@ -104,6 +104,7 @@ TEST_F(EKFTestCVModel, convergence) } time.pop_back(); + #ifdef GNUPLOT_ENABLE Gnuplot gp; gp << "set terminal qt size 1600,1000\n"; // Modified to make plot larger gp << "set multiplot layout 2,1\n"; @@ -126,4 +127,5 @@ TEST_F(EKFTestCVModel, convergence) gp.send1d(std::make_tuple(time, x_true_u)); gp.send1d(std::make_tuple(time, x_est_u)); gp << "unset multiplot\n"; + #endif } \ No newline at end of file diff --git a/vortex-filtering/test/numerical_integration_test.cpp b/vortex-filtering/test/numerical_integration_test.cpp index 6d5d19ac..6c07b5aa 100644 --- a/vortex-filtering/test/numerical_integration_test.cpp +++ b/vortex-filtering/test/numerical_integration_test.cpp @@ -76,6 +76,7 @@ class NumericalIntegration : public ::testing::Test { void plot_result(std::string title = "ERK convergence") { + #ifdef GNUPLOT_ENABLE // Plot first state and true solution against time Gnuplot gp; gp << "set terminal wxt size 1200,800\n"; @@ -87,6 +88,8 @@ class NumericalIntegration : public ::testing::Test { gp << "plot '-' with lines title 'True', '-' with lines title 'Approx'\n"; gp.send1d(std::make_tuple(t, vortex::plotting::extract_state_series(x_exact, 0))); gp.send1d(std::make_tuple(t, vortex::plotting::extract_state_series(x_est, 0))); + #endif + (void)title; } }; diff --git a/vortex-filtering/test/probability_test.cpp b/vortex-filtering/test/probability_test.cpp index 6d45fcf2..edae4d29 100644 --- a/vortex-filtering/test/probability_test.cpp +++ b/vortex-filtering/test/probability_test.cpp @@ -94,6 +94,7 @@ TEST(MultiVarGauss, sample) double minorAxisLength = cov_ellipse.minor_axis(); double angle = cov_ellipse.angle_deg(); + #ifdef GNUPLOT_ENABLE Gnuplot gp; gp << "set xrange [-10:10]\nset yrange [-10:10]\n"; gp << "set style circle radius 0.05\n"; @@ -103,6 +104,7 @@ TEST(MultiVarGauss, sample) gp << "set object 1 ellipse center " << true_mean(0) << "," << true_mean(1) << " size " << majorAxisLength << "," << minorAxisLength << " angle " << angle << "fs empty border lc rgb 'cyan'\n"; gp << "replot\n"; + #endif EXPECT_TRUE(isApproxEqual(mean, true_mean, 0.5)); EXPECT_TRUE(isApproxEqual(cov, true_cov, 0.5)); diff --git a/vortex-filtering/test/ukf_test.cpp b/vortex-filtering/test/ukf_test.cpp index fb876407..4abc72bc 100644 --- a/vortex-filtering/test/ukf_test.cpp +++ b/vortex-filtering/test/ukf_test.cpp @@ -105,7 +105,6 @@ TEST_F(UKFtest, Convergence) double tol = 1e-1; // Plot results - Gnuplot gp; std::vector x_est_mean, z_est_mean, x_est_std, x_p_std, x_m_std; for (int i = 0; i < n_steps; i++) { @@ -116,6 +115,8 @@ TEST_F(UKFtest, Convergence) x_m_std.push_back(x_est.at(i).mean()(0) - std::sqrt(x_est.at(i).cov()(0, 0))); // x_est - std } + #ifdef GNUPLOT_ENABLE + Gnuplot gp; gp << "set terminal wxt size 1200,800\n"; gp << "set title 'UKF convergence'\n"; gp << "set xlabel 'Time [s]'\n"; @@ -130,6 +131,7 @@ TEST_F(UKFtest, Convergence) gp.send1d(std::make_tuple(time, x_true)); gp.send1d(std::make_tuple(time, x_est_mean)); gp.send1d(std::make_tuple(time, z_meas)); + #endif // Check convergence