ros3djs icon indicating copy to clipboard operation
ros3djs copied to clipboard

Best practices for ROS websocket objects?

Open aamirhatim opened this issue 4 years ago • 3 comments

Let's say I have a 3D viewer that displays lidar data for my robot. Now I want to create a second 3D viewer that shows a map that is being generated by a package like gmapping. What would be a recommended best practice - a single ROSLIB.Ros() object that gets passed to both viewers' visualization components, or a separate ROSLIB.Ros() object for each viewer? I currently am implementing the first option but since I'm quite new to web dev and RWT libraries I wanted to reach out to the community for any thoughts on this.

aamirhatim avatar Jun 03 '21 22:06 aamirhatim

I think it is best practice to reuse the ROS object.

MatthijsBurgh avatar Jun 04 '21 07:06 MatthijsBurgh

What is your reasoning behind using the single ROS object?

aamirhatim avatar Jul 05 '21 16:07 aamirhatim

Easier to debug; Single instance which maintains a connection, etc.

MatthijsBurgh avatar Jul 06 '21 09:07 MatthijsBurgh