ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Plot 3D surface in Hydro

asked 2014-03-25 02:03:58 -0500

Haikal Pribadi gravatar image

updated 2016-10-24 09:02:43 -0500

ngrennan gravatar image

Hi everyone,

I'm trying to find how to plot 3D data that represents a surface, over time. It should basically look like a grid surface that moves, in a 3d plot. I know this should be a simple task, does anyone have any ideas?

PS: an equivalent of what I am trying to achieve is like the surf() function in MATLAB.

Thank you, everyone.

edit retag flag offensive close merge delete


Just to clarify: rxplot as well as rqt_plot are both only plotting single numeric values over time. So neither of them will fit your needs.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-03-26 07:42:44 -0500 )edit

yep, I realized that after looking into it a little more. That was a bad example. I will edit my question, thanks :)

Haikal Pribadi gravatar image Haikal Pribadi  ( 2014-03-26 10:54:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-03-25 20:55:32 -0500

jbinney gravatar image

You can write a C++ or python ROS node that constructs and publishes an rviz marker: . POINTS or TRIANGLE_LIST marker types would probably work.

If you want something more like matlab, but don't want to use matlab for some reason, you could try using the 3d plotting in the matplotlib python package:

edit flag offensive delete link more


Thank you! We're almost there.. RViz seems convenient, but do you know if there's any way I can plot my data to show like this wireframe plot: ?

Haikal Pribadi gravatar image Haikal Pribadi  ( 2014-03-26 06:46:08 -0500 )edit

To get that kind of plot in rviz you'll have to write some code. Shouldn't be too hard to write C++ or python to generate a grid of points in the XY plane, evaluate your function to get Z at each point, and make a LINE_LIST rviz Marker that displays the surface. You'll have to write that code though

jbinney gravatar image jbinney  ( 2014-03-26 23:15:21 -0500 )edit

Thanks jbinney, i've went with RVIZ for now.

Haikal Pribadi gravatar image Haikal Pribadi  ( 2014-03-27 07:27:35 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-03-25 02:03:58 -0500

Seen: 1,411 times

Last updated: Mar 26 '14