Home | Tutorials | Wiki | Issues
Ask Your Question
0

Floor plan to simple mesh?

asked 2017-02-22 08:27:39 -0600

Pi Robot gravatar image

updated 2017-02-22 15:08:35 -0600

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>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-02-22 09:50:24 -0600

nkoenig gravatar image

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.

edit flag offensive delete link more

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.

Pi Robot gravatar imagePi Robot ( 2017-02-22 15:06:32 -0600 )edit
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2017-02-22 08:27:39 -0600

Seen: 786 times

Last updated: Feb 22 '17