ami-iit / yarp-openmct

Repo for YARP and OpenMCT integration.
BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link

connection form /icubSim/inertial port drops right after startup of iCub Telemetry server #6

Closed nunoguedelha closed 3 years ago

nunoguedelha commented 3 years ago

How to reproduce the issue

We get on the same terminal the following log messages:

> iCubTelemVizServer@1.0.0 start /Users/nunoguedelha/dev/yarp-openmct/iCubTelemVizServer
> node iCubTelemVizServer.js

iCub Telemetry server launched!
[INFO] |yarp.os.Port| Port /yarpjs/inertial:i active at tcp://192.168.1.18:10060/
[INFO] |yarp.os.impl.PortCoreInputUnit| Receiving input from /icubSim/inertial to /yarpjs/inertial:i using tcp
[INFO] |yarp.os.Port| Port /yarpjs/left_leg/stateExt:o active at tcp://192.168.1.18:10061/
[INFO] |yarp.os.impl.PortCoreInputUnit| Receiving input from /icubSim/left_leg/stateExt:o to /yarpjs/left_leg/stateExt:o using tcp
[INFO] |yarp.os.Port| Port /yarpjs/camLeftEye:i active at tcp://192.168.1.18:10062/
[INFO] |yarp.os.Port| Port /yarpjs/camRightEye:i active at tcp://192.168.1.18:10063/
ICubTelemetry History hosted at http://localhost:8081/history
ICubTelemetry Realtime hosted at ws://localhost:8081/realtime
listening on http://localhost:3000
/yarpjs/inertial:i
[INFO] |yarp.os.impl.PortCoreInputUnit| Removing input from /icubSim/inertial to /yarpjs/inertial:i  <=======
nunoguedelha commented 3 years ago

Analysis

Under "Problems" tab when running the telemetry server from Webstorm, we get the warning:

Unresolved variable or type cubtelemetry

A typo was introduced in 4aed406bb225fb7da5fbc8cb00d737d9a7ced3ee:

https://github.com/dic-iit/yarp-openmct/blob/18bdf99a9f5b7c08eacbae16b36a2fff59ff14d8/iCubTelemVizServer/iCubTelemVizServer.js#L67-L69

This causes all the updates of the bottle type connections (IMU, joint positions telemetry sources) to fail, and the the connection form /icubSim/inertial to drop. If in the table portInConfig defining the ports configurations...

https://github.com/dic-iit/yarp-openmct/blob/18bdf99a9f5b7c08eacbae16b36a2fff59ff14d8/iCubTelemVizServer/iCubTelemVizServer.js#L55-L60

...we comment all entries except the one for port /icubSim/inertial..., instead of the warning we get the error:

/Users/nunoguedelha/dev/yarp-openmct/iCubTelemVizServer/iCubTelemVizServer.js:68
                cubtelemetry.updateState(id,bottle.toArray());
                ^

ReferenceError: cubtelemetry is not defined
    at /Users/nunoguedelha/dev/yarp-openmct/iCubTelemVizServer/iCubTelemVizServer.js:68:17
    at /Users/nunoguedelha/dev/yarp-openmct/iCubTelemVizServer/node_modules/YarpJS/yarp.js:184:13

npm ERR! Darwin 19.6.0
npm ERR! argv "/Users/nunoguedelha/.nvm/versions/node/v4.2.2/bin/node" "/Users/nunoguedelha/.nvm/versions/node/v4.2.2/bin/npm" "start"
npm ERR! node v4.2.2
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! iCubTelemVizServer@1.0.0 start: `node iCubTelemVizServer.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the iCubTelemVizServer@1.0.0 start script 'node iCubTelemVizServer.js'.
npm ERR! This is most likely a problem with the iCubTelemVizServer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node iCubTelemVizServer.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls iCubTelemVizServer
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/nunoguedelha/dev/yarp-openmct/iCubTelemVizServer/npm-debug.log
nunoguedelha commented 3 years ago

After fixing the typo, everything goes back to normal:

[INFO] |yarp.os.Port| Port /yarpjs/camLeftEye:i active at tcp://127.0.0.1:10057/
[INFO] |yarp.os.Port| Port /yarpjs/camRightEye:i active at tcp://127.0.0.1:10058/
ICubTelemetry History hosted at http://localhost:8081/history
ICubTelemetry Realtime hosted at ws://localhost:8081/realtime
listening on http://localhost:3000
connected
image image
nunoguedelha commented 3 years ago

~Fixed by #7 .~

nunoguedelha commented 3 years ago

Fixed in #9 .