ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

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

Comments

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
2

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: http://wiki.ros.org/rviz/DisplayTypes... . 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: http://matplotlib.org/1.3.1/mpl_toolk...

edit flag offensive delete link more

Comments

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: http://matplotlib.org/1.3.1/mpl_toolkits/mplot3d/tutorial.html#wireframe-plots ?

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

Question Tools

1 follower

Stats

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

Seen: 1,473 times

Last updated: Mar 26 '14