0

I have two ROS packages, each running a websocket server on the same PORT.

Is that's what's throwing this boost:: error?

node: /usr/include/boost/smart_ptr/shared_ptr.hpp:734: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = gazebo::transport::Publication; typename boost::detail::sp_member_access<T>::type = gazebo::transport::Publication*]: Assertion `px != 0' failed.

Is there a websocket server configuration that can allow two different ROS nodes to listen on the same PORT?

Thank you

sehe
  • 374,641
  • 47
  • 450
  • 633
ruionda
  • 1
  • 1
  • What would it mean for both nodes to listen to the same port? Which one receives a new connection? It looks like it could be related only if there was a lack of error handling on binding the listener socket (bind/listen). Otherwise, it just looks as if Publication was accessed when it no longer exists. Or it was never initialized. – sehe Apr 25 '21 at 22:32
  • thanks @sehe This sounds plausible since this error is the very first output line upon npm start of the dual-node package, where one of the nodes creates a ROSlibjs topic, Subscribes it and then Publishes it (in that order). – ruionda Apr 26 '21 at 21:15
  • in the case of this dual-node package, the first node is instantiated by the start script in package.json, and the second one is created within the main.js. The start-up order can be inverted, but I was getting the same boost error from either sequence. – ruionda Apr 26 '21 at 21:17
  • can a WebSocket server support two ROS nodes (both essentially publishing and subscring but unrelated topics) on the same PORT or is that a conflict? – ruionda Apr 26 '21 at 21:20
  • That is a conflict, in the current situation. You can see how it matches the last para in this answer: https://stackoverflow.com/a/670897/85371 – sehe Apr 26 '21 at 21:23
  • @sehe in regards to the https://stackoverflow.com/a/670897/85371 method(s), should I follow the Linux or Windows, to make this work on WSL2/Ubuntu? – ruionda Apr 27 '21 at 10:24

1 Answers1

0

I had the same problem, using this command worked for me.

source /usr/share/gazebo/setup.sh

Bijin Abraham
  • 1,709
  • 2
  • 11
  • 25