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

Setting near/far clip planes in gazebo visualization

asked 2012-01-05 01:21:36 -0500

updated 2014-01-28 17:11:04 -0500

ngrennan gravatar image

Using gazebo, I often get noticable artifacts which I strongly suspect to be related to Z-Fighting due to the far clip plane being unnecessary far away (or the near clip plane being close). How can I set the near and far clip planes for the visualization window? Searching for combinations of "gazebo, z-buffer, clip planes, near, far, z-fighting" I didn't find an answer.

/edit: The flickering effect is well visible in this video. Note that the default gazebo visualization camera exhibits severe flickering, while the camera sensor plugin based view doesn't show the effect at all (most likely because it has more reasonable near/far clip planes).

/Update I made a video of the pr2_gazebo wg world scenario started using

roslaunch pr2_gazebo pr2_wg_world.launch

As is easily visible, the static geometry is flickering severely.

/Update: Some images that demonstrate the problem:

View looking ok:

image description

Now, if I just rotate the camera very slightly (no translation), I get very visible rendering artifacts:

image description

Different camera location, same story (even if the first view already has some parts clipping through the walls, which they definitely shouldn't geometry-wise): image description

After slight camera rotation:

image description

/edit: With increasing distance, one can get lucky and get an acceptable view: image description

but slight rotation also changes this to have severe artifacts: image description

This happens all the time on my machine and leads to severe flickering as soon as I move the camera around. The machine is a 64Bit Natty system with ROS electric from .debs with a nvidia GPU.

/edit: I created ticket 42 on this at the gazebo trac here.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-03-21 10:49:23 -0500

hsu gravatar image

It turns out the problem is that the user camera (gui view) has too large of a range for near/far clip at 0.001 to 4000 meters. By reducing the range this strange z-fighting effect is reduced. The fixes should go out with the next electric release.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-01-05 01:21:36 -0500

Seen: 1,949 times

Last updated: Mar 21 '12