[ros-users] Gazebo - spawn_model

Nicolás Alvarez Picco nicolasapicco at hotmail.com
Wed Nov 10 16:54:23 UTC 2010


John, 
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. 
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.
Any idea?? Do you think I am having this problem because the map is very big??

Thanks!!!

Nicolas



From: johnhsu at willowgarage.com
Date: Tue, 9 Nov 2010 17:46:11 -0800
To: ros-users at code.ros.org
Subject: Re: [ros-users] Gazebo - spawn_model

Nicolás,

>From your console output it looks like gazebo is looking for a file 
/home/robot/src/autnavarc/ros-ana-pkg/wheelchair/fete_nico_mapa.png

but you mentioned you had saved map.png in
/home/robot/src/ros/stacks/simulator_gazebo/gazebo_worlds/Media/materials/textures



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

and your grayscale map image file is located at


/home/robot/src/ros/stacks/simulator_gazebo/gazebo_worlds/Media/materials/textures/fete_nico_mapa.png

John



2010/11/9 Nicolás Alvarez Picco <nicolasapicco at hotmail.com>







Hi John,
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:

Param [quickStep] is deprecated: [replace quickStep with stepType]


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


Error: [/home/robot/src/ros/stacks/simulator_gazebo/gazebo/build/gazebo-r8947/server/rendering/Image.cc:136]
Unable to open image file[/home/robot/src/autnavarc/ros-ana-pkg/wheelchair/fete_nico_mapa.png]


/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]

Main simulation loop failed


/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]

Service call failed: transport error completing service call: unable to receive data from sender, check sender's logs for details


spawning success None
[gazebo-2] process has died [pid 3701, exit code -11].
log files: /home/robot/.ros/log/0bd3add0-ec25-11df-a9ef-0026b9e75b87/gazebo-2*.log


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


 


I saved my map in

 /home/robot/src/ros/stacks/simulator_gazebo/gazebo_worlds/Media/materials/textures

Any idea?

Thanks 

Nicolas


From: johnhsu at willowgarage.com


Date: Tue, 9 Nov 2010 07:29:20 -0800
To: ros-users at code.ros.org
Subject: Re: [ros-users] Gazebo - spawn_model

Hi Nicolas,



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.





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.

John





2010/11/9 Nicolás Alvarez Picco <nicolasapicco at hotmail.com>







Hi Everybody!!!

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:

<launch>

  <arg name="scenario"/>




  <arg name="no_window"/>
  <!-- start gazebo with an empty plane -->
  <param name="/use_sim_time" value="true" />

  <!-- if no window is set then start with -r (no window displayed) -->




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




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




  
  <!-- walls-->
  <param name="walls" textfile="$(find han_Scene)/scenarios/$(arg scenario)/walls.model" />

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





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





</launch>

Where the file walls.model is 

<?xml version="1.0" ?>
<model:physical name="walls_model"
  xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model" 




  xmlns:body="http://playerstage.sourceforge.net/gazebo/xmlschema/#body" 
  xmlns:geom="http://playerstage.sourceforge.net/gazebo/xmlschema/#geom" >





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




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




      <offset>0 0 0</offset>
      <material>Gazebo/Rocky</material>
    </geom:map>
  </body:map>
</model:physical>

The thing is that nothing happens in gazebo. 




Any clue?? Does exist any documentation about how to spawn walls of a map??

Many thanks

Nicolas
 		 	   		  

_______________________________________________

ros-users mailing list

ros-users at code.ros.org

https://code.ros.org/mailman/listinfo/ros-users





_______________________________________________
ros-users mailing list
ros-users at code.ros.org
https://code.ros.org/mailman/listinfo/ros-users 		 	   		  

_______________________________________________

ros-users mailing list

ros-users at code.ros.org

https://code.ros.org/mailman/listinfo/ros-users





_______________________________________________
ros-users mailing list
ros-users at code.ros.org
https://code.ros.org/mailman/listinfo/ros-users 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20101110/b5682631/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fete_nico_mapa.png
Type: image/png
Size: 16816 bytes
Desc: not available
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20101110/b5682631/attachment-0004.png>


More information about the ros-users mailing list