Skip to content

Commit 9ceab34

Browse files
authored
Merge pull request #1201 from luxonis/fix/remote_connection_checks
Add pipeline checks to RemoteConnection's exposePipelineService method
2 parents f5bd0dd + 62e6139 commit 9ceab34

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

bindings/python/src/pipeline/PipelineBindings.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ void PipelineBindings::bind(pybind11::module& m, void* pCallstack){
258258
}
259259
p.stop();
260260
})
261+
.def("build", &Pipeline::build)
262+
.def("isBuilt", &Pipeline::isBuilt)
261263
.def("isRunning", &Pipeline::isRunning)
262264
.def("processTasks", &Pipeline::processTasks, py::arg("waitForTasks") = false, py::arg("timeoutSeconds") = -1.0)
263265
.def("enableHolisticRecord", &Pipeline::enableHolisticRecord, py::arg("recordConfig"), DOC(dai, Pipeline, enableHolisticRecord))

src/remote_connection/RemoteConnectionImpl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "foxglove/websocket/common.hpp"
1111
#include "pipeline/datatype/Buffer.hpp"
1212
#include "pipeline/datatype/ImgAnnotations.hpp"
13+
#include "utility/ErrorMacros.hpp"
1314
#include "utility/Logging.hpp"
1415
#include "utility/ProtoSerializable.hpp"
1516
#include "utility/Resources.hpp"
@@ -352,6 +353,10 @@ void RemoteConnectionImpl::exposeKeyPressedService() {
352353
}
353354

354355
void RemoteConnectionImpl::exposePipelineService(const Pipeline& pipeline) {
356+
// Make sure pipeline is built so that we can serialize it.
357+
// If not built, an error is thrown is case there are host -> device or device -> host connections.
358+
DAI_CHECK(pipeline.isBuilt(), "Pipeline is not built. Call Pipeline::build first!");
359+
355360
std::vector<foxglove::ServiceWithoutId> services;
356361
auto pipelineService = foxglove::ServiceWithoutId();
357362
pipelineService.name = "pipelineSchema";

0 commit comments

Comments
 (0)