Back Home
In trying to run the publish test project from the tutorial, i get the error ./publish: error while loading shared libraries: libzcm.so: cannot open shared object file: No such file or directory
If you see this error when trying to use anything zcm related, then you probably have a problem with your LD_LIBRARY_PATH environment variable. Try echoing $LD_LIBRARY_PATH and verifying that it points to /usr/lib:/usr/local/lib. If it doesn't (which is weird), point it there yourself with:
export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
Add that line to the bottom of your ~/.bashrc to make it permanent.
Have you tried running your program with ZCM_DEBUG=1 in front of it? This enables debug output from zcm which should help you diagnose your problems
Calling the subscribe / unsubscribe functions modifies the same internal data structures as
the dispatch code reads during callbacks. Due to a lock, calling these functions from within a
callback causes a deadlock. You should therefore alter the subscriptions outside of your callbacks.
If your code really needs to change subscriptions in response to a received message, try using a queue
to pass the work to another thread or in your main-loop if using zcm_handle.
NodeJS' garbage collector will come around and clean up a subscription unless that subscription is referenced elsewhere in your code. The easiest way to get around this problem is by calling unsubscribe on all your subscriptions on process.exit
process.on('exit', function() { z.unsubscribe(sub); });