Replies: 8 comments 1 reply
-
Fyi @nunoguedelha |
Beta Was this translation helpful? Give feedback.
-
Hello @ste93, I'm implementing for AMI-IIT lab a telemetry visualizer based on Node.js (https://github.com/ami-iit/yarp-openmct), which uses Yarp Javascript bindings and websocket support through https://github.com/robotology/yarp.js. I'm happy to see that websocket support is making its way into Yarp native features. Is there a release plan for your implementation, or an ongoing PR? |
Beta Was this translation helpful? Give feedback.
-
I was looking around and remembered this: #2621. So this is the a further iteration following the initial one #2621 ? |
Beta Was this translation helpful? Give feedback.
-
hi @nunoguedelha, actually part of the websocket incorporated in yarp has been already released (see #2621), for the library part we are experiencing issues in porting yarp in javascript (as explained above) and so we are at a still point, there is no expected release date for now. You can find a part of the library here https://github.com/ste93/yarp-websocket-library but for now we're not olanning any release of it |
Beta Was this translation helpful? Give feedback.
-
Great! Thanks for the info. Regarding the porting of Yarp on JS, out of curiosity, is the implementation close to or based on what was done in https://github.com/robotology/yarp.js? |
Beta Was this translation helpful? Give feedback.
-
no the implementation is standalone since the other if i'm not wrong requires a server to be started, this implementation has an idea to talk directly from a web page to yarp server without any external server and network. |
Beta Was this translation helpful? Give feedback.
-
Hi @ste93 , sorry I didn't have time to react sooner to your message... I'm not sure what you mean by "external server". There are two distinct things covered by robotology/yarp.js:
My initial question was about the Javascript/Yarp-C++ bindings sub-module. Whatever "browser communicator" (bridge) is already implemented on YARP, it could re-use the binding functions in that sub-module. |
Beta Was this translation helpful? Give feedback.
-
Hi @nunoguedelha, I was referring to external server as the express HTTP server, now websocket communication are integrated in yarp. |
Beta Was this translation helpful? Give feedback.
-
websocket:
work done:
websocket implementation inside yarp
tried compiling yarp into javascript with emscripten
code:
emcmake cmake .. -DYCM_DIR=/home/ste/ws/ycm/build -DSKIP_ACE=ON -DBUILD_SHARED_LIBS=OFF
emmake make -j16 YARP_os
/home/ste/programs/emsdk/upstream/emscripten/tools/webidl_binder ../Bottle.idl glue
em++ -s WASM=0 -ferror-limit=0 -s LINKABLE=1 -s EXPORT_ALL=1 -s MODULARIZE=1 -I../src/libYARP_conf/src/ -Isrc/libYARP_conf/src/ -I../src/libYARP_os/src/ lib/libYARP_os.a lib/libYARP_priv_hmac.a ../bottle_idl.cpp -s STRICT=0 --bind -s LLD_REPORT_UNDEFINED --no-entry -o out.js -s EXPORT_NAME=pippo -s USE_PTHREADS -s WASM_BIGINT
the error returned is
wasm2js: /b/s/w/ir/cache/builder/emscripten-releases/binaryen/src/passes/I64ToI32Lowering.cpp:471: void wasm::I64ToI32Lowering::visitAtomicCmpxchg(wasm::AtomicCmpxchg *): Assertion `curr->type != Type::i64 && "64-bit AtomicCmpxchg not implemented"' failed.
em++: error: '/home/ste/programs/emsdk/upstream/bin/wasm2js --emscripten lib.wasm --mvp-features --enable-threads --enable-mutable-globals --enable-bulk-memory --enable-sign-ext' failed (received SIGABRT (-6))
I think the operation Cmpxchg is not implemented in 64 bits, also with lowering.
the operation is in wasm (https://github.com/WebAssembly/binaryen) in file https://github.com/WebAssembly/binaryen/blob/main/src/passes/I64ToI32Lowering.cpp
if you compile em++ with WASM=1 then you can reproduce the error with:
wasm2js --emscripten lib.wasm --mvp-features --enable-threads --enable-mutable-globals --enable-bulk-memory --enable-sign-ext
a small javascript library (https://github.com/ste93/yarp-websocket-library) contains the websocket management together with a small bottle manager.
it is implemented only for bottle messages, other types of messages are not implemented (like images)_ but images can be retrieved via image src="http://yarp http protocol"
another functionality implemented is to query the server to get portnames.
Beta Was this translation helpful? Give feedback.
All reactions