Robot model meshes in RViz

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Robot model meshes in RViz

Armin Hornung
Hi!

I have a few meshes which I converted from VRML to STL to be rendered as
robot body parts (specified in the robot's URDF). Is it possible to make
the RViz rendering more "smooth"? A different Ogre-based rendering tool
displays the curvatures very smooth, while RViz seems to display each
triangle as a flat surface (no interpolation of the surface normals). If
I look at the meshes in Meshlab, the RViz view corresponds to "flat",
while what I want to achieve corresponds to "smooth". Maybe there is a
setting that I need to activate in the Mesh file or the URDF?

Secondly, is it possible to have multiple mesh parts / files per robot
link? It seems like additional "visual" or "mesh" tags after the first
one are ignored. Or do I have to create virtual (fixed) robot links for
them? Alternatively, is it possible to have one multi-colored mesh? What
I would like to achieve is to have a robot link that has
differently-colored parts.

Best regards,
Armin

--
Armin Hornung                              Albert-Ludwigs-Universität
www.informatik.uni-freiburg.de/~hornunga   Dept. of Computer Science
[hidden email]        Humanoid Robots Lab
Tel.: +49 (0)761-203-8010                  Georges-Köhler-Allee 79
Fax : +49 (0)761-203-8007                  D-79110 Freiburg, Germany

_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|

Re: Robot model meshes in RViz

John Hsu
Hi Armin,
for your second question, I've answered inline:

On Wed, Jul 14, 2010 at 5:49 AM, Armin Hornung <[hidden email]> wrote:
Hi!

I have a few meshes which I converted from VRML to STL to be rendered as
robot body parts (specified in the robot's URDF). Is it possible to make
the RViz rendering more "smooth"? A different Ogre-based rendering tool
displays the curvatures very smooth, while RViz seems to display each
triangle as a flat surface (no interpolation of the surface normals). If
I look at the meshes in Meshlab, the RViz view corresponds to "flat",
while what I want to achieve corresponds to "smooth". Maybe there is a
setting that I need to activate in the Mesh file or the URDF?

Secondly, is it possible to have multiple mesh parts / files per robot
link? It seems like additional "visual" or "mesh" tags after the first
one are ignored. Or do I have to create virtual (fixed) robot links for
them?

URDF allows only one mesh per link.  On the other hand, Gazebo's model XML does allow multiple geometries per body, but does not work with most ROS components.
 
Alternatively, is it possible to have one multi-colored mesh? What
I would like to achieve is to have a robot link that has
differently-colored parts.

You can texture map the mesh.  For example, PR2 Gazebo model in cturtle uses textured COLLADA meshes for visualization.  You can take a look at the pr2_description package for reference.

John
 

Best regards,
Armin

--
Armin Hornung                              Albert-Ludwigs-Universität
www.informatik.uni-freiburg.de/~hornunga   Dept. of Computer Science
[hidden email]        Humanoid Robots Lab
Tel.: +49 (0)761-203-8010                  Georges-Köhler-Allee 79
Fax : +49 (0)761-203-8007                  D-79110 Freiburg, Germany

_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users


_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|

Re: Robot model meshes in RViz

Josh Faust
In reply to this post by Armin Hornung
On Wed, Jul 14, 2010 at 5:49 AM, Armin Hornung <[hidden email]> wrote:
Hi!

I have a few meshes which I converted from VRML to STL to be rendered as
robot body parts (specified in the robot's URDF). Is it possible to make
the RViz rendering more "smooth"? A different Ogre-based rendering tool
displays the curvatures very smooth, while RViz seems to display each
triangle as a flat surface (no interpolation of the surface normals). If
I look at the meshes in Meshlab, the RViz view corresponds to "flat",
while what I want to achieve corresponds to "smooth". Maybe there is a
setting that I need to activate in the Mesh file or the URDF?

rviz will use whatever normals are specified in the STL file, unless they're magnitude 0 (and thus invalid... a lot of tools don't write normals into STL files), in which case it calculates the face normal.

_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|

Re: Robot model meshes in RViz

Armin Hornung
In reply to this post by Armin Hornung
Hi John and Josh,

> URDF allows only one mesh per link.  On the other hand, Gazebo's model XML
> does allow multiple geometries per body, but does not work with most ROS
> components.
>    
I think it would make sense to add that capability (multiple geometries
as visual, be it primitive shapes or meshes) to RViz in the future. That
would make it much easier to build simple robots or sensors out of
multiple primitive shapes, instead of designing a completely textured 3D
mesh. E.g. a Pioneer robot is just a cylinder with a few boxes, a Hokuyo
a box with a cylinder on top etc.
I created a tracker item here: https://code.ros.org/trac/ros-pkg/ticket/4270

> You can texture map the mesh.  For example, PR2 Gazebo model in cturtle uses
> textured COLLADA meshes for visualization.  You can take a look at the
> pr2_description<https://code.ros.org/svn/wg-ros-pkg/stacks/pr2_common/tags/cturtle/pr2_description>package
> for reference.
>
>    
Yes, I saw these nice new PR2 models which made me want to have a
nice-looking robot model too :)
Unfortunately, I don't know how to easily create a texture for an
existing colored mesh. meshlab can't create textures out of colored
vertices yet (but vice versa), and I never got to use Blender properly.

> rviz will use whatever normals are specified in the STL file, unless they're
> magnitude 0 (and thus invalid... a lot of tools don't write normals into STL
> files), in which case it calculates the face normal.
>    
I think the normals are fine. The original VRML mesh has none, but
Meshlab creates them and saves them into the STL. It's more a matter of
how the surfaces are rendered *between* the vertices. VRML files for
example have a "crease angle" field that defines the smoothness of the
surface:
http://www.vislab.uq.edu.au/users/manuals/vrml97/slides/mt0252.htm

Again, I think it would make sense to add that functionality to RViz if
that can be done efficiently, maybe as part of the "mesh" or "geometry"
tag. It would also make spheres and cylinders look really round and not
like blocky polygons, without using too many vertices. I also created a
tracker for that:
https://code.ros.org/trac/ros-pkg/ticket/4271

I know these are purely aesthetical requests, but I thought they would
be nice to have if they don't use too many resources (otherwise, best
make them optional). As motivation, I attached the same mesh as it is
rendered in RViz and in a different OGRE-based renderer.

Cheers,
Armin

--
Armin Hornung                              Albert-Ludwigs-Universität
www.informatik.uni-freiburg.de/~hornunga   Dept. of Computer Science
[hidden email]        Humanoid Robots Lab
Tel.: +49 (0)761-203-8010                  Georges-Köhler-Allee 79
Fax : +49 (0)761-203-8007                  D-79110 Freiburg, Germany


_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users

head2.png (7K) Download Attachment
head1.png (30K) Download Attachment