MCPcopy Create free account
hub / github.com/MIT-SPARK/Kimera-VIO / getInputPacket

Method getInputPacket

src/visualizer/Visualizer3DModule.cpp:30–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 visualizer_(std::move(visualizer)){};
29
30VisualizerModule::InputUniquePtr VisualizerModule::getInputPacket() {
31 bool queue_state = false;
32 VizMesherInput mesher_payload = nullptr;
33 if (PIO::parallel_run_) {
34 queue_state = mesher_queue_.popBlocking(mesher_payload);
35 } else {
36 queue_state = mesher_queue_.pop(mesher_payload);
37 }
38
39 if (!queue_state) {
40 LOG_IF(WARNING, PIO::parallel_run_)
41 << "Module: " << name_id_ << " - Mesher queue is down";
42 VLOG_IF(1, !PIO::parallel_run_)
43 << "Module: " << name_id_ << " - Mesher queue is empty or down";
44 return nullptr;
45 }
46
47 CHECK(mesher_payload);
48 const Timestamp& timestamp = mesher_payload->timestamp_;
49
50 // Look for the synchronized packet in frontend payload queue
51 // This should always work, because it should not be possible to have
52 // a backend payload without having a frontend one first!
53 VizFrontendInput frontend_payload = nullptr;
54 PIO::syncQueue(timestamp, &frontend_queue_, &frontend_payload);
55 CHECK(frontend_payload);
56 CHECK(frontend_payload->is_keyframe_);
57
58 VizBackendInput backend_payload = nullptr;
59 PIO::syncQueue(timestamp, &backend_queue_, &backend_payload);
60 CHECK(backend_payload);
61
62 // Push the synced messages to the visualizer's input queue
63 return VIO::make_unique<VisualizerInput>(
64 timestamp, mesher_payload, backend_payload, frontend_payload);
65}
66
67VisualizerModule::OutputUniquePtr VisualizerModule::spinOnce(
68 VisualizerInput::UniquePtr input) {

Callers

nothing calls this directly

Calls 2

popBlockingMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected