diff --git a/components/net/cpp/src/dispatcher.cpp b/components/net/cpp/src/dispatcher.cpp index ec5781d6af3e69b795b7a53952c9ae70c72bbd92..a7d504627bb863b9cee8ba5976fe0b01fed211e3 100644 --- a/components/net/cpp/src/dispatcher.cpp +++ b/components/net/cpp/src/dispatcher.cpp @@ -149,7 +149,7 @@ void ftl::net::Dispatcher::dispatch_notification(Peer &s, msgpack::object const void ftl::net::Dispatcher::enforce_arg_count(std::string const &func, std::size_t found, std::size_t expected) { if (found != expected) { - LOG(FATAL) << "RPC argument missmatch - " << found << " != " << expected; + LOG(FATAL) << "RPC argument missmatch for '" << func << "' - " << found << " != " << expected; throw -1; } } diff --git a/web-service/src/index.js b/web-service/src/index.js index e10a54ab9dfe22c248ac6fb115b4d42f04e43acf..565735222149e2c9eb57a3774a55404380d580d1 100644 --- a/web-service/src/index.js +++ b/web-service/src/index.js @@ -19,8 +19,8 @@ function RGBDClient(peer, N, rate, dest) { this.txcount = 0; } -RGBDClient.prototype.push = function(uri, rgb, depth) { - this.peer.send(uri, rgb, depth); +RGBDClient.prototype.push = function(uri, frame, ttime, chunk, rgb, depth) { + this.peer.send(uri, frame, ttime, chunk, rgb, depth); this.txcount++; } @@ -35,8 +35,8 @@ function RGBDStream(uri, peer) { this.rxcount = 10; this.rxmax = 10; - peer.bind(uri, (rgb, depth) => { - this.pushFrames(rgb, depth); + peer.bind(uri, (frame, ttime, chunk, rgb, depth) => { + this.pushFrames(frame, ttime, chunk, rgb, depth); this.rxcount++; if (this.rxcount >= this.rxmax && this.clients.length > 0) { this.subscribe(); @@ -64,12 +64,12 @@ RGBDStream.prototype.subscribe = function() { this.peer.send("get_stream", this.uri, 10, 0, [Peer.uuid], this.uri); } -RGBDStream.prototype.pushFrames = function(rgb, depth) { +RGBDStream.prototype.pushFrames = function(frame, ttime, chunk, rgb, depth) { this.rgb = rgb; this.depth = depth; for (let i=0; i < this.clients.length; i++) { - this.clients[i].push(this.uri, rgb, depth); + this.clients[i].push(this.uri, frame, ttime, chunk, rgb, depth); } let i=0; @@ -176,6 +176,10 @@ app.ws('/', (ws, req) => { checkStreams(p); }); + p.bind("__ping__", () => { + return Date.now(); + }); + p.bind("node_details", () => { return ['{"title": "FTL Web-Service", "id": "0", "kind": "master"}']; }); @@ -194,10 +198,18 @@ app.ws('/', (ws, req) => { } }); - p.proxy("source_details", (cb, uri) => { + p.proxy("source_details", (cb, uri, chan) => { + let peer = uri_data[uri].peer; + if (peer) { + peer.rpc("source_details", cb, uri, chan); + } + }); + + p.proxy("get_pose", (cb, uri) => { + //console.log("SET POSE"); let peer = uri_data[uri].peer; if (peer) { - peer.rpc("source_details", cb, uri); + peer.rpc("get_pose", cb, uri); } });