diff --git a/applications/gui/src/main.cpp b/applications/gui/src/main.cpp index 55dff365695a15de6ffb90ae119f3a29cc180cdb..5d428a6058ec12520b9ae007f64a7ee71c0cc11c 100644 --- a/applications/gui/src/main.cpp +++ b/applications/gui/src/main.cpp @@ -183,8 +183,9 @@ class FTLApplication : public nanogui::Screen { new Label(window, "Select source","sans-bold"); auto available = net->findAll<string>("list_streams"); auto select = new ComboBox(window, available); - select->setCallback([this,&available](int ix) { + select->setCallback([this,available](int ix) { LOG(INFO) << "Change source: " << ix; + }); setVisible(true); diff --git a/components/rgbd-sources/include/ftl/net_source.hpp b/components/rgbd-sources/include/ftl/net_source.hpp index 9730aef155801ae895751c8eb9eca61c465c12bd..c95437da81a75a11084a853221218cbced87e05d 100644 --- a/components/rgbd-sources/include/ftl/net_source.hpp +++ b/components/rgbd-sources/include/ftl/net_source.hpp @@ -29,6 +29,7 @@ class NetSource : public RGBDSource { } void setPose(const Eigen::Matrix4f &pose); + void setURI(const std::string &uri); private: bool has_calibration_; diff --git a/components/rgbd-sources/include/ftl/rgbd_source.hpp b/components/rgbd-sources/include/ftl/rgbd_source.hpp index ca7dec6ac18d54716d5a07c1f924b4b097b91548..29e0a9fd9c143d21bed0b3861354db4378f883fe 100644 --- a/components/rgbd-sources/include/ftl/rgbd_source.hpp +++ b/components/rgbd-sources/include/ftl/rgbd_source.hpp @@ -30,6 +30,7 @@ class RGBDSource : public ftl::Configurable { const CameraParameters &getParameters() { return params_; }; std::string getURI() const { return config_["uri"].get<std::string>(); } + virtual void setURI(const std::string &uri); virtual void setPose(const Eigen::Matrix4f &pose) { pose_ = pose; }; const Eigen::Matrix4f &getPose() { return pose_; }; diff --git a/components/rgbd-sources/src/net_source.cpp b/components/rgbd-sources/src/net_source.cpp index ce4e6cc422b65b5ccee2792f46ec2c703211c062..5084063f96d39c123fdd4be5d20ffc06d9a2257a 100644 --- a/components/rgbd-sources/src/net_source.cpp +++ b/components/rgbd-sources/src/net_source.cpp @@ -85,6 +85,11 @@ void NetSource::setPose(const Eigen::Matrix4f &pose) { RGBDSource::setPose(pose); } +void NetSource::setURI(const std::string &uri) { + RGBDSource::setURI(uri); + has_calibration_ = _getCalibration(*net_, peer_, getURI(), params_); +} + void NetSource::grab() { // net_.broadcast("grab"); } diff --git a/components/rgbd-sources/src/rgbd_source.cpp b/components/rgbd-sources/src/rgbd_source.cpp index df70d45437127e543c12b573b662c9833d92a103..0279d9ba5781381f891bdbe028e7e3dac88bdcc8 100644 --- a/components/rgbd-sources/src/rgbd_source.cpp +++ b/components/rgbd-sources/src/rgbd_source.cpp @@ -24,6 +24,10 @@ bool RGBDSource::isReady() { return false; } +void RGBDSource::setURI(const std::string &uri) { + config_["uri"] = uri; +} + void RGBDSource::getRGBD(cv::Mat &rgb, cv::Mat &depth) { unique_lock<mutex> lk(mutex_); rgb_.copyTo(rgb);