Skip to content

Commit

Permalink
Merge pull request #1201 from luxonis/fix/remote_connection_checks
Browse files Browse the repository at this point in the history
Add pipeline checks to RemoteConnection's exposePipelineService method
  • Loading branch information
lnotspotl authored Dec 20, 2024
2 parents f5bd0dd + 62e6139 commit 9ceab34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bindings/python/src/pipeline/PipelineBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ void PipelineBindings::bind(pybind11::module& m, void* pCallstack){
}
p.stop();
})
.def("build", &Pipeline::build)
.def("isBuilt", &Pipeline::isBuilt)
.def("isRunning", &Pipeline::isRunning)
.def("processTasks", &Pipeline::processTasks, py::arg("waitForTasks") = false, py::arg("timeoutSeconds") = -1.0)
.def("enableHolisticRecord", &Pipeline::enableHolisticRecord, py::arg("recordConfig"), DOC(dai, Pipeline, enableHolisticRecord))
Expand Down
5 changes: 5 additions & 0 deletions src/remote_connection/RemoteConnectionImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "foxglove/websocket/common.hpp"
#include "pipeline/datatype/Buffer.hpp"
#include "pipeline/datatype/ImgAnnotations.hpp"
#include "utility/ErrorMacros.hpp"
#include "utility/Logging.hpp"
#include "utility/ProtoSerializable.hpp"
#include "utility/Resources.hpp"
Expand Down Expand Up @@ -352,6 +353,10 @@ void RemoteConnectionImpl::exposeKeyPressedService() {
}

void RemoteConnectionImpl::exposePipelineService(const Pipeline& pipeline) {
// Make sure pipeline is built so that we can serialize it.
// If not built, an error is thrown is case there are host -> device or device -> host connections.
DAI_CHECK(pipeline.isBuilt(), "Pipeline is not built. Call Pipeline::build first!");

std::vector<foxglove::ServiceWithoutId> services;
auto pipelineService = foxglove::ServiceWithoutId();
pipelineService.name = "pipelineSchema";
Expand Down

0 comments on commit 9ceab34

Please sign in to comment.