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

fix: fix Boost.Optional build error on Jazzy #7602

Merged
merged 15 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "autoware/signal_processing/lowpass_filter_1d.hpp"

#include <boost/optional/optional_io.hpp>

#include <gtest/gtest.h>

constexpr double epsilon = 1e-6;
Expand All @@ -25,7 +27,7 @@ TEST(lowpass_filter_1d, filter)
LowpassFilter1d lowpass_filter_1d(0.1);

// initial state
EXPECT_EQ(lowpass_filter_1d.getValue(), boost::none);
EXPECT_FALSE(lowpass_filter_1d.getValue());

// random filter
EXPECT_NEAR(lowpass_filter_1d.filter(0.0), 0.0, epsilon);
Expand All @@ -35,7 +37,7 @@ TEST(lowpass_filter_1d, filter)

// reset without value
lowpass_filter_1d.reset();
EXPECT_EQ(lowpass_filter_1d.getValue(), boost::none);
EXPECT_FALSE(lowpass_filter_1d.getValue());

// reset with value
lowpass_filter_1d.reset(-1.1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "autoware/signal_processing/lowpass_filter.hpp"

#include <boost/optional/optional_io.hpp>

#include <gtest/gtest.h>

constexpr double epsilon = 1e-6;
Expand Down Expand Up @@ -41,7 +43,7 @@ TEST(lowpass_filter_twist, filter)
LowpassFilterTwist lowpass_filter_(0.1);

{ // initial state
EXPECT_EQ(lowpass_filter_.getValue(), boost::none);
EXPECT_FALSE(lowpass_filter_.getValue());
}

{ // random filter
Expand All @@ -58,7 +60,7 @@ TEST(lowpass_filter_twist, filter)

{ // reset without value
lowpass_filter_.reset();
EXPECT_EQ(lowpass_filter_.getValue(), boost::none);
EXPECT_FALSE(lowpass_filter_.getValue());
}

{ // reset with value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "autoware/universe_utils/math/unit_conversion.hpp"
#include "object_recognition_utils/predicted_path_utils.hpp"

#include <boost/optional/optional_io.hpp>

#include <gtest/gtest.h>

using autoware::universe_utils::Point2d;
Expand Down Expand Up @@ -75,7 +77,7 @@ TEST(predicted_path_utils, testCalcInterpolatedPose)
for (double t = 0.0; t < 9.0 + 1e-6; t += 1.0) {
const auto p = calcInterpolatedPose(path, t);

EXPECT_NE(p, boost::none);
EXPECT_TRUE(p);
EXPECT_NEAR(p->position.x, t * 1.0, epsilon);
EXPECT_NEAR(p->position.y, 0.0, epsilon);
EXPECT_NEAR(p->position.z, 0.0, epsilon);
Expand All @@ -92,7 +94,7 @@ TEST(predicted_path_utils, testCalcInterpolatedPose)
for (double t = 0.0; t < 9.0; t += 0.3) {
const auto p = calcInterpolatedPose(path, t);

EXPECT_NE(p, boost::none);
EXPECT_TRUE(p);
EXPECT_NEAR(p->position.x, t * 1.0, epsilon);
EXPECT_NEAR(p->position.y, 0.0, epsilon);
EXPECT_NEAR(p->position.z, 0.0, epsilon);
Expand All @@ -108,20 +110,20 @@ TEST(predicted_path_utils, testCalcInterpolatedPose)
// Negative time
{
const auto p = calcInterpolatedPose(path, -1.0);
EXPECT_EQ(p, boost::none);
EXPECT_FALSE(p);
}

// Over the time horizon
{
const auto p = calcInterpolatedPose(path, 11.0);
EXPECT_EQ(p, boost::none);
EXPECT_FALSE(p);
}

// Empty Path
{
PredictedPath empty_path;
const auto p = calcInterpolatedPose(empty_path, 5.0);
EXPECT_EQ(p, boost::none);
EXPECT_FALSE(p);
}
}
}
Expand Down
Loading