It looks like the map file is in RGB mode.  I've done two things here, made unknown spaces white (originally gray) and changed the image to grayscale mode.  Please let me know if this doesn't work.<br>John<br><br><div class="gmail_quote">

2010/11/10 Nicolás Alvarez Picco <span dir="ltr"><<a href="mailto:nicolasapicco@hotmail.com">nicolasapicco@hotmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">





<div>
John, <br>There are not problems with the location of the files, when I said map.png it was just to name the map with a generic name. <br>The thing is I can't make the gazebo work with that map. The map is the result of running the gmapping node, so it doesn't have the borders so delemetated, here I attach the file png file.<br>

Any idea?? Do you think I am having this problem because the map is very big??<div class="im"><br><br>Thanks!!!<br><br>Nicolas<br><br><br><br><hr>From: <a href="mailto:johnhsu@willowgarage.com" target="_blank">johnhsu@willowgarage.com</a><br>

</div>Date: Tue, 9 Nov 2010 17:46:11 -0800<div><div></div><div class="h5"><br>To: <a href="mailto:ros-users@code.ros.org" target="_blank">ros-users@code.ros.org</a><br>Subject: Re: [ros-users] Gazebo - spawn_model<br><br>

Nicolás,<br><br>From your console output it looks like gazebo is looking for a file <br>/home/robot/src/autnavarc/ros-ana-pkg/wheelchair/fete_nico_mapa.png<br><div><br>but you mentioned you had saved map.png in<br></div>
/home/robot/src/ros/stacks/simulator_gazebo/gazebo_worlds/Media/materials/textures<br>


<div><br>possibly double check your parameter "walls" containing walls.model and make sure the image tag contains only the file name, e.g.<br><image>fete_nico_mapa.png</image><br><br>and your grayscale map image file is located at<br>



/home/robot/src/ros/stacks/simulator_gazebo/gazebo_worlds/Media/materials/textures/fete_nico_mapa.png<br><br>John<br><br></div><br><br><div>2010/11/9 Nicolás Alvarez Picco <span dir="ltr"><<a href="mailto:nicolasapicco@hotmail.com" target="_blank">nicolasapicco@hotmail.com</a>></span><br>



<blockquote style="padding-left: 1ex;">



<div>
Hi John,<br>Thanks for answering, I ve tried with that you suggest me and also with executing in a new terminal "convert myfile.pgm myfile.png " but it is still giving this message:<br><br>Param [quickStep] is deprecated: [replace quickStep with stepType]<br>



Param [quickStepIters] is deprecated: [replace quickStepIters with stepIters]<br>Param [quickStepW] is deprecated: [replace quickStepW with stepW]<br>[ INFO] [1289322971.691105690]: Obtained obstacle map.<br>Gazebo successfully initialized<br>



<font color="#ff0000">Error: [/home/robot/src/ros/stacks/simulator_gazebo/gazebo/build/gazebo-r8947/server/rendering/Image.cc:136]</font><br>Unable to open image file[/home/robot/src/autnavarc/ros-ana-pkg/wheelchair/fete_nico_mapa.png]<br>



/home/robot/src/ros/stacks/simulator_gazebo/gazebo/build/gazebo-r8947/server/physics/MapShape.cc:117 : Exception: Unable to open image file[/home/robot/src/autnavarc/ros-ana-pkg/wheelchair/fete_nico_mapa.png]<br><br>Main simulation loop failed<br>



/home/robot/src/ros/stacks/simulator_gazebo/gazebo/build/gazebo-r8947/server/physics/MapShape.cc:117 : Exception: Unable to open image file[/home/robot/src/autnavarc/ros-ana-pkg/wheelchair/fete_nico_mapa.png]<br><br>Service call failed: transport error completing service call: unable to receive data from sender, check sender's logs for details<br>



spawning success None<br><font color="#ff0000">[gazebo-2] process has died [pid 3701, exit code -11].</font><font color="#ff0000"><br></font><font color="#ff0000">log files: /home/robot/.ros/log/0bd3add0-ec25-11df-a9ef-0026b9e75b87/gazebo-2*.log</font><br>



[xml2factor_walls-3] process has finished cleanly.<br>log file: /home/robot/.ros/log/0bd3add0-ec25-11df-a9ef-0026b9e75b87/xml2factor_walls-3*.log<br>[ INFO] [1289322976.775538978, 0.958000000]: Server up<br>[ INFO] [1289322976.777365139, 0.958000000]: Spinning now<br>



 <br><br><br>I saved my map in<br><br> /home/robot/src/ros/stacks/simulator_gazebo/gazebo_worlds/Media/materials/textures<br><br>Any idea?<br><br>Thanks <br><br>Nicolas<br><br><br><hr>From: <a href="mailto:johnhsu@willowgarage.com" target="_blank">johnhsu@willowgarage.com</a><br>



Date: Tue, 9 Nov 2010 07:29:20 -0800<br>To: <a href="mailto:ros-users@code.ros.org" target="_blank">ros-users@code.ros.org</a><br>Subject: Re: [ros-users] Gazebo - spawn_model<div><div></div><div><br><br>Hi Nicolas,<br>

<br>I don't think gazebo can read pgm files.  Try opening your map file in gimp, save it as a grayscale .png file.  Place the file in a package that exports its prefix to gazebo_media_path (for example take a look at manifest.xml for gazebo_worlds), under a subdirectory [package_name]/Media/materials/texture/walls.png.<br>





<br>Then try your spawn again.  Note that if the map is complicated, it might take gazebo's recursive rectangle wall builder more than 30 sec. to construct the model.<br><br>John<br><br><br><br><div>

2010/11/9 Nicolás Alvarez Picco <span dir="ltr"><<a href="mailto:nicolasapicco@hotmail.com" target="_blank">nicolasapicco@hotmail.com</a>></span><br><blockquote style="padding-left: 1ex;">





<div>
Hi Everybody!!!<br><br>I have made a map with gmapping, it is a file 'map.pgm'. Now I want to spawn its walls, for that I am using this launch file:<br><br><launch><br><br>  <arg name="scenario"/><br>





  <arg name="no_window"/><br>  <!-- start gazebo with an empty plane --><br>  <param name="/use_sim_time" value="true" /><br><br>  <!-- if no window is set then start with -r (no window displayed) --><br>





  <node name="gazebo" pkg="gazebo" type="gazebo" args="-r $(find han_Scene)/worlds/empty.world" respawn="false" output="screen" if="$(arg no_window)"/><br>





  <br>  <!-- Otherwise start normally --><br>  <node name="gazebo" pkg="gazebo" type="gazebo" args="$(find han_Scene)/worlds/empty.world" respawn="false" output="screen" unless="$(arg no_window)"/><br>





  <br>  <!-- walls--><br>  <param name="walls" textfile="$(find han_Scene)/scenarios/$(arg scenario)/walls.model" /><br><br>  <node name="xml2factor_walls" pkg="gazebo" type="spawn_model" args="-gazebo -param walls -model walls" respawn="false" output="screen" /><br>





<br>  <!-- <node name="xml2factor_walls" pkg="gazebo" type="spawn_model" args="-gazebo -param walls -x -16 -y -16 -model walls" respawn="false" output="screen" /> --><br>





<br></launch><br><br>Where the file walls.model is <br><br><?xml version="1.0" ?><br><model:physical name="walls_model"<br>  xmlns:model="<a href="http://playerstage.sourceforge.net/gazebo/xmlschema/#model" target="_blank">http://playerstage.sourceforge.net/gazebo/xmlschema/#model</a>" <br>





  xmlns:body="<a href="http://playerstage.sourceforge.net/gazebo/xmlschema/#body" target="_blank">http://playerstage.sourceforge.net/gazebo/xmlschema/#body</a>" <br>  xmlns:geom="<a href="http://playerstage.sourceforge.net/gazebo/xmlschema/#geom" target="_blank">http://playerstage.sourceforge.net/gazebo/xmlschema/#geom</a>" ><br>





<br>  <static>true</static><br>  <body:map name="walls_body"><br>    <xyz>-8 -8 0 </xyz><br>    <geom:map name="walls_geom"><br>      <image>map.pgm</image> <!-- for now this is in the gazebo model dir, change later--><br>





      <height>2</height><br>      <threshold>200</threshold><br>      <granularity>1</granularity><br>      <negative>false</negative><br>      <scale>0.04</scale><br>





      <offset>0 0 0</offset><br>      <material>Gazebo/Rocky</material><br>    </geom:map><br>  </body:map><br></model:physical><br><br>The thing is that nothing happens in gazebo. <br>





Any clue?? Does exist any documentation about how to spawn walls of a map??<br><br>Many thanks<br><br>Nicolas<br>                                           </div>
<br>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org" target="_blank">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br></blockquote></div><br>
<br></div></div>_______________________________________________
ros-users mailing list
<a href="mailto:ros-users@code.ros.org" target="_blank">ros-users@code.ros.org</a>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a>                                     </div>
<br>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org" target="_blank">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br></blockquote></div><br>
<br></div></div>_______________________________________________
ros-users mailing list
<a href="mailto:ros-users@code.ros.org" target="_blank">ros-users@code.ros.org</a>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a>                                     </div>
<br>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br></blockquote></div><br>