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

Add kimera spectacular data provider #353

Merged
merged 33 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c039280
adding video common
efahnestock Dec 9, 2024
3b208fa
lint
efahnestock Dec 9, 2024
c399960
reformat image compare into video directory
efahnestock Dec 10, 2024
97a2959
lint
efahnestock Dec 10, 2024
323f1b1
adding video common
efahnestock Dec 9, 2024
ec691f0
lint
efahnestock Dec 9, 2024
b1643f7
wip from Euroc example
efahnestock Nov 27, 2024
0fafbd4
first pass at IMU translation, adding tests
efahnestock Dec 3, 2024
1053a65
adding imu tests
efahnestock Dec 6, 2024
88ee62a
adding patch for opengv
efahnestock Dec 9, 2024
9ca377f
integrating patches to kimera vio and updating sha
efahnestock Dec 9, 2024
125e3b9
finishing up frame delivery
efahnestock Dec 9, 2024
156534c
updating log test to use video common
efahnestock Dec 9, 2024
2c2f73b
lint
efahnestock Dec 9, 2024
d8a53a3
cleanup
efahnestock Dec 10, 2024
0513473
incorperating video package changes
efahnestock Dec 10, 2024
dbb2926
removing kimera vio test
efahnestock Dec 10, 2024
26e4de2
addresing pr comments
efahnestock Dec 10, 2024
d5a98b7
remove build for removed pipeline test
efahnestock Dec 10, 2024
0b804ea
disable spec log test while in transition to float depth images
efahnestock Dec 10, 2024
1904163
fixing build flag
efahnestock Dec 10, 2024
af5c3ef
Update common/video/image_compare.cc
efahnestock Dec 12, 2024
1c3a7e5
Merge branch 'add_kimera_spectacular_data_provider' of github.com:ewf…
efahnestock Dec 12, 2024
60cbe37
swap to snake case for non inherited functions, change to tiff file
efahnestock Dec 12, 2024
8f9ac1a
Merge branch 'main' into add_kimera_spectacular_data_provider
efahnestock Dec 12, 2024
525352b
Merge branch 'add_kimera_spectacular_data_provider' of github.com:ewf…
efahnestock Dec 12, 2024
e846881
fix clang format from merge
efahnestock Dec 12, 2024
c1381a7
add snippet generated from logger app
ewfuentes Dec 12, 2024
7939f22
lint
ewfuentes Dec 12, 2024
9c8f60c
addressing pr comments
efahnestock Dec 16, 2024
ac5cbbc
Merge branch 'add_kimera_spectacular_data_provider' of github.com:ewf…
efahnestock Dec 16, 2024
5b2bc4e
lint
efahnestock Dec 16, 2024
5b88b27
re-enable spectacular log test
ewfuentes Dec 17, 2024
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
10 changes: 3 additions & 7 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ http_archive(
strip_prefix="opengv-91f4b19c73450833a40e463ad3648aae80b3a7f3",
build_file="//third_party:BUILD.opengv",
patch_args = ["-p1"],
patches = ["//third_party:opengv_0001-prefix-unsupported-eigen-include-paths.patch"],
patches = ["//third_party:opengv_0001-prefix-unsupported-eigen-include-paths.patch",
"//third_party:opengv_0002-unused-parameter.patch"],
integrity = "sha256-gIK3IvE6rGDpxvN3BA+EPFKPvZ7Zi7Ix33IIcm2RULA="
)

Expand All @@ -539,12 +540,7 @@ http_archive(
urls = ["https://github.com/ewfuentes/Kimera-VIO/archive/master.zip"],
strip_prefix = "Kimera-VIO-master",
build_file = "//third_party:BUILD.kimera_vio",
integrity = "sha256-8fLHPn8JPWffnnXEA0gJbZrBhoGpK0Gw80I3oWXpgZg=",
patch_args = ["-p1"],
patches = [
"//third_party:kimera_vio_0001-add-missing-includes.patch",
"//third_party:kimera_vio_0002-add-override-markers.patch",
]
integrity = "sha256-+hQBAPv4bDRbYnH1iXeuHTNsWnfXgqZ0FoUTv6usQ/k=",
)

http_archive(
Expand Down
2 changes: 1 addition & 1 deletion common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ cc_test(
"@bs_thread_pool",
"@com_google_googletest//:gtest_main",
],
)
)
15 changes: 15 additions & 0 deletions common/video.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "opencv2/opencv.hpp"
efahnestock marked this conversation as resolved.
Show resolved Hide resolved

namespace robot::common {

bool images_equal(const cv::Mat& img1, const cv::Mat& img2) {
if (img1.size() != img2.size() || img1.type() != img2.type()) {
return false;
}
cv::Mat diff;
cv::absdiff(img1, img2, diff);
diff = diff.reshape(1);
return cv::countNonZero(diff) == 0;
}

} // namespace robot::common
9 changes: 9 additions & 0 deletions common/video.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once
efahnestock marked this conversation as resolved.
Show resolved Hide resolved

#include "opencv2/opencv.hpp"

namespace robot::common {

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

}
21 changes: 21 additions & 0 deletions common/video/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package(features=["warning_compile_flags"])

cc_library(
name = "image_compare",
hdrs = ["image_compare.hh"],
srcs = ["image_compare.cc"],
deps = [
"@eigen//:eigen",
"@opencv",
],
visibility = ["//visibility:public"],
)

cc_test(
name = "image_compare_test",
srcs = ["image_compare_test.cc"],
deps = [
":image_compare",
"@com_google_googletest//:gtest_main",
]
)
15 changes: 15 additions & 0 deletions common/video/image_compare.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "opencv2/opencv.hpp"
efahnestock marked this conversation as resolved.
Show resolved Hide resolved
efahnestock marked this conversation as resolved.
Show resolved Hide resolved

namespace robot::common::video {

bool images_equal(const cv::Mat& img1, const cv::Mat& img2) {
if (img1.size() != img2.size() || img1.type() != img2.type()) {
return false;
}
cv::Mat diff;
cv::absdiff(img1, img2, diff);
diff = diff.reshape(1);
return cv::countNonZero(diff) == 0;
}

} // namespace robot::common::video
9 changes: 9 additions & 0 deletions common/video/image_compare.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

#include "opencv2/opencv.hpp"

namespace robot::common::video {

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

}
33 changes: 33 additions & 0 deletions common/video/image_compare_test.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "common/video/image_compare.hh"

#include <gtest/gtest.h>

#include "opencv2/opencv.hpp"

namespace robot::common::video {

TEST(ImageCompareTest, ImagesEqual_SameImages) {
cv::Mat img1 = cv::Mat::zeros(100, 100, CV_8UC3);
cv::Mat img2 = img1.clone();
EXPECT_TRUE(images_equal(img1, img2));
}

TEST(ImageCompareTest, ImagesEqual_DifferentSizes) {
cv::Mat img1 = cv::Mat::zeros(100, 100, CV_8UC3);
cv::Mat img2 = cv::Mat::zeros(200, 200, CV_8UC3);
EXPECT_FALSE(images_equal(img1, img2));
}

TEST(ImageCompareTest, ImagesEqual_DifferentTypes) {
cv::Mat img1 = cv::Mat::zeros(100, 100, CV_8UC3);
cv::Mat img2 = cv::Mat::zeros(100, 100, CV_8UC1);
EXPECT_FALSE(images_equal(img1, img2));
}

TEST(ImageCompareTest, ImagesEqual_DifferentContent) {
cv::Mat img1 = cv::Mat::zeros(100, 100, CV_8UC3);
cv::Mat img2 = cv::Mat::ones(100, 100, CV_8UC3);
EXPECT_FALSE(images_equal(img1, img2));
}

} // namespace robot::common::video
35 changes: 33 additions & 2 deletions experimental/overhead_matching/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


package(features=["warning_compile_flags"])

load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
Expand Down Expand Up @@ -31,6 +29,7 @@ cc_test(
":spectacular_log",
"@com_google_googletest//:gtest_main",
"@fmt",
"//common/video:image_compare",
]
)

Expand All @@ -50,3 +49,35 @@ py_binary(
requirement("numpy"),
],
)


cc_library(
name = "kimera_spectacular_data_provider",
hdrs = ["kimera_spectacular_data_provider.hh"],
srcs = ["kimera_spectacular_data_provider.cc"],
copts = ["-Wno-sign-compare"],
deps = [
"@kimera_vio",
":spectacular_log",
]
)
cc_test(
name = "kimera_spectacular_data_provider_test",
srcs = ["kimera_spectacular_data_provider_test.cc"],
data = ["@spectacular_log_snippet//:files"],
copts = ["-Wno-sign-compare"],
deps = [
":kimera_spectacular_data_provider",
"@com_google_googletest//:gtest_main",
"//common/video:image_compare",
]
)
cc_test(
name = "kimera_vio_pipeline_test",
srcs = ["kimera_vio_pipeline_test.cc"],
copts = ["-Wno-sign-compare"],
deps = [
":kimera_spectacular_data_provider",
"@com_google_googletest//:gtest_main",
]
)
Loading
Loading