MCPcopy Create free account
hub / github.com/MIT-SPARK/Clio / ObjectUpdateFunctorTests

Class ObjectUpdateFunctorTests

clio/tests/test_object_update_functor.cpp:28–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28struct ObjectUpdateFunctorTests : public ::testing::Test {
29 ObjectUpdateFunctorTests()
30 : graph_info({{DsgLayers::SEGMENTS, 's'},
31 {DsgLayers::OBJECTS, 'o'},
32 {DsgLayers::PLACES, 'p'}}) {
33 config.tasks = test::TestEmbeddingGroup::getDefault(2);
34 }
35
36 void SetUp() override {}
37
38 void addSegment(size_t index,
39 double min,
40 double max,
41 std::optional<size_t> onehot_index = std::nullopt) {
42 auto attrs = std::make_unique<KhronosObjectAttributes>();
43 attrs->position << (min + max) / 2.0, 0.0, 0.0;
44
45 Eigen::Vector3f x_min(min, -1.0, -1.0);
46 Eigen::Vector3f x_max(max, 1.0, 1.0);
47 attrs->bounding_box = BoundingBox(x_min, x_max);
48 attrs->semantic_feature =
49 test::TestEmbeddingGroup::getEmbedding(onehot_index.value_or(index));
50
51 graph().emplaceNode(DsgLayers::SEGMENTS, NodeSymbol('s', index), std::move(attrs));
52 }
53
54 DynamicSceneGraph& graph() { return *graph_info.graph; }
55
56 SharedDsgInfo graph_info;
57 ObjectUpdateFunctor::Config config;
58};
59
60TEST_F(ObjectUpdateFunctorTests, AddEdges) {
61 ObjectUpdateFunctor functor(config);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected