Skip to content

Commit

Permalink
Merge branch 'add_kimera_spectacular_data_provider' of github.com:ewf…
Browse files Browse the repository at this point in the history
…uentes/robot into add_kimera_spectacular_data_provider
  • Loading branch information
efahnestock committed Dec 16, 2024
2 parents 9c8f60c + 7939f22 commit ac5cbbc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,9 @@ http_archive(

http_archive(
name = "spectacular_log_snippet",
urls = ["https://www.dropbox.com/scl/fi/2u4ec000kx24980t7ifjz/recording_2024-11-21_13-36-30.zip?rlkey=ojw96yykmw9crtqs15kbxwnvp&st=gjcrawhw&dl=1"],
urls = ["https://www.dropbox.com/scl/fi/6y2x4nstw7h3xx6jvbzzg/20241212_150605.zip?rlkey=rwktg7egzki7vqeq9qpfaml1l&dl=1"],
build_file = "//third_party:BUILD.zip_file",
integrity = "sha256-K+KFNzufwccL4vEJLErEtNKNVjnWStClXVF2mKpI6lI="
integrity = "sha256-7WD3AyKE+v7fA6ohAqk1UXBU+i2n9uH/6HcovNhORhA="
)

http_archive(
Expand Down
11 changes: 10 additions & 1 deletion common/video/image_compare.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@ bool images_equal(const cv::Mat& img1, const cv::Mat& img2) {
return false;
}
cv::Mat diff;
cv::absdiff(img1, img2, diff);
if (img1.type() == CV_32F) {
cv::Mat img1_no_nan = img1;
cv::Mat img2_no_nan = img2;
cv::patchNaNs(img1_no_nan);
cv::patchNaNs(img2_no_nan);
cv::absdiff(img1_no_nan, img2_no_nan, diff);
} else {
cv::absdiff(img1, img2, diff);
}
diff = diff.reshape(1);

return cv::countNonZero(diff) == 0;
}

Expand Down
2 changes: 1 addition & 1 deletion common/video/image_compare.hh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ namespace robot::common::video {

bool images_equal(const cv::Mat& img1, const cv::Mat& img2);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ bool compare_depth_frame(const std::unique_ptr<VIO::DepthFrame>& kimera_depth,

TEST(KimeraSpectacularDataProviderTest, happy_case) {
// Setup
const std::filesystem::path log_path(
"external/spectacular_log_snippet/recording_2024-11-21_13-36-30");
const std::filesystem::path log_path("external/spectacular_log_snippet/20241212_150605");
SpectacularLog log(log_path);

// get initial IMU information
Expand Down
3 changes: 1 addition & 2 deletions experimental/overhead_matching/spectacular_log_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ std::ostream &operator<<(std::ostream &out, const time::RobotTimestamp &t) {

TEST(SpectacularLogTest, DISABLED_happy_case) {
// Setup
const std::filesystem::path log_path(
"external/spectacular_log_snippet/recording_2024-11-21_13-36-30");
const std::filesystem::path log_path("external/spectacular_log_snippet/20241212_150605");
SpectacularLog log(log_path);
// Action

Expand Down

0 comments on commit ac5cbbc

Please sign in to comment.