blodow / realtime_urdf_filter

ROS package that can filter geometry defined in URDF models from Kinect depth images. Can also preprocess data for the OpenNI tracker, to remove backgrounds, robots etc.
Other
89 stars 46 forks source link

support primitive shapes (cylinders, boxes, spheres, ...) #33

Closed christian-rauch closed 3 years ago

christian-rauch commented 3 years ago

It seems that simple shapes, such as cylinders, are not supported when they are defined by their parameters in the URDF (http://wiki.ros.org/urdf/XML/link#Elements) instead of providing them as mesh.

blodow commented 3 years ago

Hey Christian, could you check if your URDF model has the cylinder geometry in the <visual> or the <collision> tags? It's been a couple of years I've been using this package, but my code seems to only look at the <visual> tag. (https://github.com/blodow/realtime_urdf_filter/blob/master/src/urdf_renderer.cpp#L105-L109)

christian-rauch commented 3 years ago

It's in the visual tag:

    <visual>
      <origin rpy="0 0 0" xyz="0 0 0.0185"/>
      <geometry>
        <cylinder length="0.037" radius="0.035"/>
      </geometry>
      <material name="LightGrey">
        <color rgba="0.6 0.6 0.6 1.0"/>
      </material>
    </visual>

I also see it in RViz, but the link is missing in the "Debug" GUI.

blodow commented 3 years ago

then maybe it's this here? :D https://github.com/blodow/realtime_urdf_filter/blob/5ab2992977855d2e7b430bd279ef3c3ff256a136/src/renderable.cpp#L96

Others, e.g. Cube, are also commented, I think we never used URDF models with these links, and couldn't/didn't test it properly.

christian-rauch commented 3 years ago

then maybe it's this here? :D

Bingo! :-) This fixes the issue.

I added that "fix" to my PR.