Re: [ros-users] Gazebo - spawn_model

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
> args="-gazebo -param walls -x -16 -y -16 -model walls" respawn="false" > > output="screen" /> -->%0A>%20>%0A>%20>%20</launch>%0A>%20>%0A>%20>%20Where%20the%20file%20walls.model%20is%0A>%20>%0A>%20>%20<?xml%20version=%221.0%22%20?>%0A>%20>%20<model:physical%20name=%22walls_model%22%0A>%20>%20%20%20xmlns:model=%22http://playerstage.sourceforge.net/gazebo/xmlschema/#model%22%0A>%20>%0A>%20>%20%20%20xmlns:body=%22http://playerstage.sourceforge.net/gazebo/xmlschema/#body%22%0A>%20>%20%20%20xmlns:geom=%22http://playerstage.sourceforge.net/gazebo/xmlschema/#geom%22%20>%0A>%20>%0A>%20>%0A>%20>%20The%20thing%20is%20that%20nothing%20happens%20in%20gazebo.%0A>%20>%20Any%20clue??%20Does%20exist%20any%20documentation%20about%20how%20to%20spawn%20walls%20of%20a%20map??%0A>%20>%0A>%20>%20Many%20thanks%0A>%20>%0A>%20>%20Nicolas%0A>%20>%0A>%20>%20_______________________________________________%0A>%20>%20ros-users%20mailing%20list%0A>%20>%20ros-users@code.ros.org%0A>%20>%20https://code.ros.org/mailman/listinfo/ros-users%0A>%20>%0A>%20>%0A>%20">Reply to this message
Author: User discussions
Date:  
To: User discussions
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 <>

> 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
>
> https://code.ros.org/mailman/listinfo/ros-users
>
>