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

URDF for a sphere

asked 2012-01-29 18:20:25 -0600

I am learning URDF, when I tried making a sphere;

<?xml version="1.0"?>
<robot name="myfirst">
  <link name="base_link">
        <sphere radius="1.0"/>
      <material name="green">
            <color rgba="0 1 0 1"/>

All I get is something more like a polyhedra;

image description

Is there any way to get a better sphere ?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-01-30 02:02:09 -0600

updated 2012-01-30 04:18:01 -0600

I'm also not aware of a way to change the tesselation of the built-in primitives in rviz. Using an external mesh works fine, however. I've used the default sphere you can add in Blender (32 segments, 16 rings) for the image below. I scaled it and set it to smooth shading (and converted to triangles before exporting to .dae to prevent bugs as mentioned here).

Gazebo on the left, rviz on the right:

image description

/edit: Two versions of a COLLADA sphere are available here. One is using 32 segments/16 rings, the other 16 segments/8 rings.

edit flag offensive delete link more


Stefan Kohlbrecher Thank you, kindly do me a favour - can you please send the files across to my email ? arkapravobhaumik at gmail dot com
Arkapravo gravatar image Arkapravo  ( 2012-01-30 02:41:50 -0600 )edit
See the updated post above :)
Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2012-01-30 04:18:44 -0600 )edit
Arkapravo gravatar image Arkapravo  ( 2012-01-30 14:18:10 -0600 )edit

answered 2012-01-30 00:21:23 -0600

DimitriProsser gravatar image

As far as I'm aware, there is not - at least not with the Gazebo default shapes. You could create your own mesh file and use that instead.

edit flag offensive delete link more


@DimitriProsser I was thinking of doing that, but if it is a problem of resolution then it will stay even with a custom made mesh ! (I have used other designing softwares, as Pro-Engineer and have got wonderful spherical shapes)
Arkapravo gravatar image Arkapravo  ( 2012-01-30 00:42:56 -0600 )edit
I think you have a misconception here, it's the default primitive in rviz that has relatively coarse tesselation. If you use a sphere with finer tesselation (for example easily done as a .stl or .dae in Blender) it will also look a lot better in rviz.
Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2012-01-30 01:29:57 -0600 )edit
@Stefan Kohlbrecher Cool, then it may be worth a try !
Arkapravo gravatar image Arkapravo  ( 2012-01-30 01:32:08 -0600 )edit
to clarify, for visualization, Gazebo creates a visualization mesh with 32 rings and 32 segments by default. For collision detection in ODE, a perfect sphere is assumed, switching collision geom will slow sim down in most cases.
hsu gravatar image hsu  ( 2012-02-11 05:50:49 -0600 )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


Asked: 2012-01-29 18:20:25 -0600

Seen: 5,997 times

Last updated: Jan 30 '12