How to embed matplot lib plot into ROS web GUI?

asked 2020-07-20 11:44:38 -0600

Py gravatar image

In my ROS package, I have a node that plots an occupancy grid map retrieved from the /map topic with a trajectory overlaid on it that is color coded according to some sensor data value as it becomes available when the robot is moved around. This uses Python matplotlib.

I also have a web GUI that is used for tele-operation. This uses rosbridge and roslibjs for interacting between my ROS nodes and the webpage using JavaScript. The GUI can currently display the occupancy grid from the /map topic but what I'd really like to do is display the plot I've made using matplotlib with the color coded trajectory overlaid on it.

Does anyone have any idea how I can embed my matplotlib plot into the web GUI using roslibjs or anything else?

edit retag flag offensive close merge delete

Comments

Did you try to load it as image? Maybe load it on same position with z-index and transparency.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2020-07-20 14:40:18 -0600 )edit

The problem is that it is not saved as an image because it is constantly changing/updating as new sensor and map data is available. Any ideas how to deal with that situation?

Py gravatar image Py  ( 2020-07-21 03:41:33 -0600 )edit