ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Thu, 27 Mar 2014 07:27:35 -0500Plot 3D surface in Hydrohttps://answers.ros.org/question/143991/plot-3d-surface-in-hydro/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.Tue, 25 Mar 2014 02:03:58 -0500https://answers.ros.org/question/143991/plot-3d-surface-in-hydro/Comment by Haikal Pribadi for <p>Hi everyone,</p>
<p>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?</p>
<p>PS: an equivalent of what I am trying to achieve is like the <strong>surf()</strong> function in MATLAB.</p>
<p>Thank you, everyone.</p>
https://answers.ros.org/question/143991/plot-3d-surface-in-hydro/?comment=144911#post-id-144911yep, I realized that after looking into it a little more. That was a bad example. I will edit my question, thanks :)Wed, 26 Mar 2014 10:54:35 -0500https://answers.ros.org/question/143991/plot-3d-surface-in-hydro/?comment=144911#post-id-144911Comment by Dirk Thomas for <p>Hi everyone,</p>
<p>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?</p>
<p>PS: an equivalent of what I am trying to achieve is like the <strong>surf()</strong> function in MATLAB.</p>
<p>Thank you, everyone.</p>
https://answers.ros.org/question/143991/plot-3d-surface-in-hydro/?comment=144801#post-id-144801Just 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.Wed, 26 Mar 2014 07:42:44 -0500https://answers.ros.org/question/143991/plot-3d-surface-in-hydro/?comment=144801#post-id-144801Answer by jbinney for <p>Hi everyone,</p>
<p>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?</p>
<p>PS: an equivalent of what I am trying to achieve is like the <strong>surf()</strong> function in MATLAB.</p>
<p>Thank you, everyone.</p>
https://answers.ros.org/question/143991/plot-3d-surface-in-hydro/?answer=144446#post-id-144446You can write a C++ or python ROS node that constructs and publishes an rviz marker: http://wiki.ros.org/rviz/DisplayTypes/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: http://matplotlib.org/1.3.1/mpl_toolkits/mplot3d/tutorial.html
Tue, 25 Mar 2014 20:55:32 -0500https://answers.ros.org/question/143991/plot-3d-surface-in-hydro/?answer=144446#post-id-144446Comment by jbinney for <p> You can write a C++ or python ROS node that constructs and publishes an rviz marker: <a href="http://wiki.ros.org/rviz/DisplayTypes/Marker">http://wiki.ros.org/rviz/DisplayTypes...</a> . POINTS or TRIANGLE_LIST marker types would probably work. </p>
<p> 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: <a href="http://matplotlib.org/1.3.1/mpl_toolkits/mplot3d/tutorial.html">http://matplotlib.org/1.3.1/mpl_toolk...</a></p>
https://answers.ros.org/question/143991/plot-3d-surface-in-hydro/?comment=145126#post-id-145126To 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 thoughWed, 26 Mar 2014 23:15:21 -0500https://answers.ros.org/question/143991/plot-3d-surface-in-hydro/?comment=145126#post-id-145126Comment by Haikal Pribadi for <p> You can write a C++ or python ROS node that constructs and publishes an rviz marker: <a href="http://wiki.ros.org/rviz/DisplayTypes/Marker">http://wiki.ros.org/rviz/DisplayTypes...</a> . POINTS or TRIANGLE_LIST marker types would probably work. </p>
<p> 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: <a href="http://matplotlib.org/1.3.1/mpl_toolkits/mplot3d/tutorial.html">http://matplotlib.org/1.3.1/mpl_toolk...</a></p>
https://answers.ros.org/question/143991/plot-3d-surface-in-hydro/?comment=144736#post-id-144736Thank 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 ?Wed, 26 Mar 2014 06:46:08 -0500https://answers.ros.org/question/143991/plot-3d-surface-in-hydro/?comment=144736#post-id-144736Comment by Haikal Pribadi for <p> You can write a C++ or python ROS node that constructs and publishes an rviz marker: <a href="http://wiki.ros.org/rviz/DisplayTypes/Marker">http://wiki.ros.org/rviz/DisplayTypes...</a> . POINTS or TRIANGLE_LIST marker types would probably work. </p>
<p> 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: <a href="http://matplotlib.org/1.3.1/mpl_toolkits/mplot3d/tutorial.html">http://matplotlib.org/1.3.1/mpl_toolk...</a></p>
https://answers.ros.org/question/143991/plot-3d-surface-in-hydro/?comment=145391#post-id-145391Thanks jbinney, i've went with RVIZ for now.Thu, 27 Mar 2014 07:27:35 -0500https://answers.ros.org/question/143991/plot-3d-surface-in-hydro/?comment=145391#post-id-145391