Home | Tutorials | Wiki | Issues
Ask Your Question
0

How to create plain color walls from a greyscale image

asked 2013-05-24 10:11:56 -0600

updated 2013-05-24 10:12:45 -0600

I want to create a simple office-like environment from an image. One possibility would be to create it using heightmaps, but I was not able to do so with only a single texture or plain color (the examples I could find all use three textures...).

Another more obvious option, since I only have 1 height, is to use the "image" option. However I have not been successful with my various tries. I am using ros fuerte with the gazebo that comes with it.

You can find below the latest environment I tested:

<gazebo version='1.0'>
  <world name='default'>
    <scene>
      <ambient rgba='0.1 0.1 0.1 1.0'/>
      <background rgba='0.7 0.7 0.7 1.0'>
        <sky material='Gazebo/CloudySky'/>
      </background>
      <shadows enabled='1'/>
    </scene>
    <physics type='ode' update_rate='0.0'>
      <gravity xyz='0.0 0.0 -9.8'/>
      <ode>
        <solver type='quick' dt='0.001000' iters='50' precon_iters='0' sor='1.3'/>
        <constraints cfm='0.0' erp='0.1' contact_max_correcting_vel='100.0' contact_surface_layer='0.001000'/>
      </ode>
    </physics>

    <!-- Ground Plane -->
    <model name='plane1_model' static='1'>
      <link name='body'>
        <collision name='geom_1'>
          <geometry>
            <plane normal='0 0 1'/>
          </geometry>
          <surface>
            <friction>
              <ode mu='10.0' mu2='10.0' fdir1='0 0 0' slip1='0' slip2='0'/>
            </friction>
            <bounce restitution_coefficient='0' threshold='1000000.0'/>
            <contact>
              <ode soft_cfm='0' soft_erp='0.2' kp='1e10' kd='1' max_vel='100.0' min_depth='0.0001'/>
            </contact>
          </surface>
        </collision>

        <visual name='visual_1' cast_shadows='0'>
          <geometry>
            <plane normal='0 0 1'/>
          </geometry>
          <material script='Gazebo/White'>
            <emissive rgba='1.0 1.0 1.0 1.0'/>
          </material>
        </visual>
      </link>
    </model>

    <model name='map' static='1'>
      <link name='link' gravity='1' self_collide='0' kinematic='0'>
        <origin pose='0.0 0.0 0.0 0.0 -0.0 0.0'/>
        <collision name='collision' laser_retro='0.0'>
          <geometry>
             <image filename='willowMap.png' scale='100' threshold ='200' height='1.0' granularity='1'/>
          </geometry>
        </collision>
        <visual name='visual' cast_shadows='1' laser_retro='0.0' transparency='0.0'>
          <material />
          <geometry>
             <image filename='willowMap.png' scale='100' threshold ='200' height='1.0' granularity='1'/>
          </geometry>
        </visual>
        <damping/>
      </link>
    </model>
    <model name='table1' static='1'>
      <origin pose='2.0 3.0 -0.010 0.0 0.0 -1.570800'/>
      <link name='body' gravity='1' self_collide='0' kinematic='0'>
        <origin pose='0.0 0.0 0.0 0.0 -0.0 0.0'/>
        <collision name='top' laser_retro='0.0'>
          <origin pose='0.0 0.0 0.620 0.0 -0.0 0.0'/>
          <geometry>
            <box size='1.4 0.5 0.050000'/>
          </geometry>
          <surface>
            <friction>
              <ode mu='-1.0' mu2='-1.0' fdir1='0.0 0.0 0.0' slip1='0.0' slip2='0.0'/>
            </friction>
            <bounce restitution_coefficient='0.0' threshold='100000.0'/>
            <contact>
              <ode soft_cfm='0.0' soft_erp='0.2' kp='1000000000000.0' kd='1.0' max_vel='100.0' min_depth='0.001000'/>
            </contact>
          </surface>
        </collision>
        <visual name='top_visual' cast_shadows='1' laser_retro='0.0' transparency='0.0'>
          <origin pose='0.0 0.0 0.010 0.0 -0.0 0.0'/>
          <geometry>
            <mesh filename ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-07-02 04:28:41 -0600

Bharath gravatar image

Use the UV texture image as your image file. It is used especially for for textures. you can look here as an example to create texture for your office.

http://www.jawa9000.com/Technical/UVs/UVs.htm
edit flag offensive delete link more

Comments

The link is unavailable

Hugo Costelha gravatar imageHugo Costelha ( 2015-03-26 09:10:43 -0600 )edit
0

answered 2015-03-26 15:55:13 -0600

From Gazebo 5.0, you can use the Building Editor to trace over a floor plan image to create walls, windows, doors and so on.

edit flag offensive delete link more

Comments

I was trying to do it with Gazebo which "comes with ROS Indigo". I will test the Building Editor as soon as I can switch to Gazebo >= 5.0

Hugo Costelha gravatar imageHugo Costelha ( 2015-04-01 10:34:43 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-05-24 10:11:56 -0600

Seen: 916 times

Last updated: Mar 26 '15