Skip to content

Commit d76f753

Browse files
committed
Feature/khronos active window (#321)
* start on active window interface * (wip) reorg and rename reconstruction module pieces * fix compilation and add graph update field * rename InputQueue to MessageQueue * update reconstruction shutdown logic * add num blocks archived to return * add generic update class for putting nodes in graph * add graph config declaration * rename FrontendModule * rename frontend queue method * udpate config field name * reshuffle map and map config * push layer flags to config in VolumetricMap * update volumetric map section * fix shutdown bug * fix graph update config slightly * avoid pgmo warning and move print * match khronos verbosity control for projective integrator * (wip) start on graph interlayer edge code for arbitrary layers * start testing graph connector * clean up and fix connector * fix active flags * add graph connector to frontend * fix active and config issues * document packet fields and methods * add default graph update config for objects * fix active window sink parsing * clean up printInfo and sink printing * maybe avoid yamlcpp warning * fix compilation error Co-authored-by: Nathan Hughes <[email protected]>
1 parent d069688 commit d76f753

File tree

68 files changed

+1660
-785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1660
-785
lines changed

config/datasets/d455_outdoor.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
map:
3-
voxels_per_side: 16
4-
voxel_size: 0.1
5-
truncation_distance: 0.3
62
map_window:
73
type: spatial
84
max_radius_m: 15.0
9-
reconstruction:
5+
active_window:
6+
volumetric_map:
7+
voxels_per_side: 16
8+
voxel_size: 0.1
9+
truncation_distance: 0.3
1010
tsdf:
1111
interpolation_method: bilinear
1212
semantic_integrator:

config/datasets/habitat.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
map:
3-
voxels_per_side: 16
4-
voxel_size: 0.1
5-
truncation_distance: 0.3
62
map_window:
73
type: spatial
84
max_radius_m: 8.0
9-
reconstruction:
5+
active_window:
6+
volumetric_map:
7+
voxels_per_side: 16
8+
voxel_size: 0.1
9+
truncation_distance: 0.3
1010
full_update_separation_s: 1.0
1111
tsdf:
1212
interpolation_method: bilinear

config/datasets/kitti_360.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
map:
3-
voxels_per_side: 16
4-
voxel_size: 0.35
5-
truncation_distance: 1.0
62
map_window:
73
type: spatial
84
max_radius_m: 30.0
9-
reconstruction:
5+
active_window:
6+
volumetric_map:
7+
voxels_per_side: 16
8+
voxel_size: 0.35
9+
truncation_distance: 1.0
1010
tsdf:
1111
use_constant_weight: true
1212
interpolation_method: bilinear

config/datasets/pennquad.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
num_poses_per_update: 1
3-
map:
4-
voxels_per_side: 16
5-
voxel_size: 0.1
6-
truncation_distance: 0.3
73
map_window:
84
type: spatial
95
max_radius_m: 8.0
10-
reconstruction:
6+
active_window:
7+
volumetric_map:
8+
voxels_per_side: 16
9+
voxel_size: 0.1
10+
truncation_distance: 0.3
1111
tsdf:
1212
interpolation_method: bilinear
1313
semantic_integrator:

config/datasets/sidpac.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
map:
3-
voxels_per_side: 16
4-
voxel_size: 0.1
5-
truncation_distance: 0.3
62
map_window:
73
type: spatial
84
max_radius_m: 8.0
9-
reconstruction:
5+
active_window:
6+
volumetric_map:
7+
voxels_per_side: 16
8+
voxel_size: 0.1
9+
truncation_distance: 0.3
1010
tsdf:
1111
interpolation_method: adaptive
1212
semantic_integrator:

config/datasets/simmons_a1.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
map:
3-
voxels_per_side: 16
4-
voxel_size: 0.1
5-
truncation_distance: 0.3
62
map_window:
73
type: spatial
84
max_radius_m: 8.0
9-
reconstruction:
5+
active_window:
6+
volumetric_map:
7+
voxels_per_side: 16
8+
voxel_size: 0.1
9+
truncation_distance: 0.3
1010
tsdf:
1111
interpolation_method: bilinear
1212
semantic_integrator:

config/datasets/simmons_jackal.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
map:
3-
voxels_per_side: 16
4-
voxel_size: 0.1
5-
truncation_distance: 0.3
62
map_window:
73
type: spatial
84
max_radius_m: 8.0
9-
reconstruction:
5+
active_window:
6+
volumetric_map:
7+
voxels_per_side: 16
8+
voxel_size: 0.1
9+
truncation_distance: 0.3
1010
tsdf:
1111
interpolation_method: bilinear
1212
semantic_integrator:

config/datasets/spot.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
map:
3-
voxels_per_side: 16
4-
voxel_size: 0.1
5-
truncation_distance: 0.3
62
map_window:
73
type: spatial
84
max_radius_m: 8.0
9-
reconstruction:
5+
active_window:
6+
volumetric_map:
7+
voxels_per_side: 16
8+
voxel_size: 0.1
9+
truncation_distance: 0.3
1010
tsdf:
1111
interpolation_method: bilinear
1212
semantic_integrator:

config/datasets/uhumans2.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
map:
3-
voxels_per_side: 16
4-
voxel_size: 0.1
5-
truncation_distance: 0.3
62
map_window:
73
type: spatial
84
max_radius_m: 8.0
9-
reconstruction:
5+
active_window:
6+
volumetric_map:
7+
voxels_per_side: 16
8+
voxel_size: 0.1
9+
truncation_distance: 0.3
1010
tsdf:
1111
interpolation_method: bilinear
1212
semantic_integrator:
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/* -----------------------------------------------------------------------------
2+
* Copyright 2022 Massachusetts Institute of Technology.
3+
* All Rights Reserved
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are met:
7+
*
8+
* 1. Redistributions of source code must retain the above copyright notice,
9+
* this list of conditions and the following disclaimer.
10+
*
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
*
15+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
*
26+
* Research was sponsored by the United States Air Force Research Laboratory and
27+
* the United States Air Force Artificial Intelligence Accelerator and was
28+
* accomplished under Cooperative Agreement Number FA8750-19-2-1000. The views
29+
* and conclusions contained in this document are those of the authors and should
30+
* not be interpreted as representing the official policies, either expressed or
31+
* implied, of the United States Air Force or the U.S. Government. The U.S.
32+
* Government is authorized to reproduce and distribute reprints for Government
33+
* purposes notwithstanding any copyright notation herein.
34+
* -------------------------------------------------------------------------- */
35+
#pragma once
36+
#include <atomic>
37+
#include <memory>
38+
#include <thread>
39+
40+
#include "hydra/active_window/active_window_output.h"
41+
#include "hydra/active_window/volumetric_window.h"
42+
#include "hydra/common/message_queue.h"
43+
#include "hydra/common/module.h"
44+
#include "hydra/common/output_sink.h"
45+
#include "hydra/input/input_packet.h"
46+
#include "hydra/reconstruction/volumetric_map.h"
47+
48+
namespace hydra {
49+
50+
class ActiveWindowModule : public Module {
51+
public:
52+
using Ptr = std::shared_ptr<ActiveWindowModule>;
53+
using InputQueue = MessageQueue<InputPacket::Ptr>;
54+
using OutputQueue = MessageQueue<ActiveWindowOutput::Ptr>;
55+
using Sink = OutputSink<uint64_t, const VolumetricMap&, const ActiveWindowOutput&>;
56+
57+
struct Config {
58+
size_t max_input_queue_size;
59+
VolumetricMap::Config volumetric_map;
60+
config::VirtualConfig<VolumetricWindow> map_window;
61+
std::vector<Sink::Factory> sinks;
62+
63+
// construct to allow downstream modules to set defaults
64+
Config(bool with_semantics = true, bool with_tracking = false);
65+
} const config;
66+
67+
ActiveWindowModule(const Config& config, const OutputQueue::Ptr& output_queue);
68+
69+
virtual ~ActiveWindowModule() = default;
70+
71+
void start() override;
72+
73+
void stop() override;
74+
75+
void save(const LogSetup& log_setup) override;
76+
77+
std::string printInfo() const override;
78+
79+
void spin();
80+
81+
bool step(const InputPacket::Ptr& input);
82+
83+
void addSink(const Sink::Ptr& sink);
84+
85+
InputQueue::Ptr queue() const { return input_queue_; }
86+
87+
const VolumetricMap& map() const { return map_; }
88+
89+
protected:
90+
virtual ActiveWindowOutput::Ptr spinOnce(const InputPacket& input) = 0;
91+
92+
void stopImpl();
93+
94+
InputQueue::Ptr input_queue_;
95+
OutputQueue::Ptr output_queue_;
96+
std::atomic<bool> should_shutdown_{false};
97+
std::unique_ptr<std::thread> spin_thread_;
98+
99+
Sink::List sinks_;
100+
101+
VolumetricMap map_;
102+
std::unique_ptr<VolumetricWindow> map_window_;
103+
};
104+
105+
void declare_config(ActiveWindowModule::Config& config);
106+
107+
} // namespace hydra

0 commit comments

Comments
 (0)