Robotics StackExchange | Archived questions

Floor plan to simple mesh?

We have floor plan (.png file) for one floor of our office building and we'd like to "extrude" the black cells in the image to make a kind of simple mesh for use in Gazebo. In other words, I'd like to turn the black lines into walls of a given height and then export the result as a Collada or STL mesh. Does anyone know of a tool that could do this automatically? I'm aware of Gazebo's ability to import a floor plan but then building the walls is a manual process. I've looked at Meshlab and Blender but so far I cannot see a way to do what I need.

Thanks! patrick

Edit 1

Thanks to the answer below, I created a test world file like the the one below. However, my floor plan is not showing up in Gazebo regardless of the values I set for scale, height, granularity and threshold. Does anyone have any suggestions or examples? Also, I am using Gazebo 2.2 under ROS Indigo.

test.world:

<?xml version="1.0"?>
<sdf version="1.4">
  <world name="default">
    <include>
      <uri>model://ground_plane</uri>
    </include>
    <include>
      <uri>model://sun</uri>
    </include>
    <model name="my_mesh">
      <pose>0 0 0  0 0 0</pose>
      <static>true</static>
      <link name="body">
        <visual name="visual">
        <geometry>
          <image>
            <uri>file://home/patrick/Dropbox/Robotics/ros/jackrabbot_testing/jr1_gazebo/models/gates_1/floor_plan/gates_1_floorplan_edited.png</uri>
            <scale>1</scale>
            <height>1</height>
            <threshold>0</threshold>
            <granularity>10</granularity>
          </image>
         </geometry>
        </visual>
      </link>
    </model>
  </world>
</sdf>

Asked by Pi Robot on 2017-02-22 09:27:39 UTC

Comments

Answers

You could use the PNG file as a heightmap. It's not perfect, but it is automatic process.

Gazebo and SDF has an image geometry. It is not widely used, and may have experience significant bit rot.

Asked by nkoenig on 2017-02-22 10:50:24 UTC

Comments

This sounds like exactly what I need so thanks! However, so far I haven't been able to get my floor plan to show up in Gazebo regardless of the values I set for scale, height, granularity and threshold. Do you have any suggestions or examples? Also I am using Gazebo 2.2 under ROS Indigo. I'll add the test world file I am using to my original question.

Asked by Pi Robot on 2017-02-22 16:06:32 UTC