Configurating a map for Rviz

asked 2014-08-06 06:58:49 -0500

Moda gravatar image

updated 2014-08-14 09:09:40 -0500

I'm using a map (392 *302) (pixel), in want to launch it in Rviz and stage. However when I launch the map in stage and Rviz, it does not overlap. Can please someone help me This is the yaml, the world and the launch file of the map Thank you very much

The Yaml file

image: incubateur.png
resolution: 0.05
origin: [0, 0, 0]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196

The world file

define topurg ranger
(
  sensor(
    range_max 30.0
    fov 270.25
    samples 1081
  )
  # generic model properties
  color "black"
  size [ 0.05 0.05 0.1 ]
)

define pr2 position
(
  size [0.5 0.5 0.25]
  origin [0 0 0 0]
  gui_nose 1
  drive "omni"
  topurg(pose [ 0.275 0.000 0 0.000 ])
)

define floorplan model
(
  # sombre, sensible, artistic
  color "gray30"

  # most maps will need a bounding box
  boundary 1

  gui_nose 0
  gui_grid 0

  gui_outline 0
  gripper_return 0
  fiducial_return 0
  ranger_return 1
)

# set the resolution of the underlying raytrace model in meters
resolution 0.02

interval_sim 100  # simulation timestep in milliseconds


window
( 
  size [ 500 500 ] 

  scale 50
)

# load an environment bitmap
floorplan
( 
  name "incubateur"
  bitmap "../maps/incubateur.png"
  size [19.65 15.1 1.0] #19.65 15.1 1.0    
  pose [-7.55 9.825 0 90 ] #-7.55 9.825 0 90 
)

# throw in a robot
pr2( pose [ -7 12 0 0 ] name "pr2" color "blue")

The launch file

<launch>
  <param name="robot_size" value="0.5" />
  <param name="linear_speed" value="2" />
  <param name="delta" value="0.05" />
  <param name="output_file" value="$(find coverage)/coverage_stat" />

  <param name="/use_sim_time" value="true"/>
  <arg name="map_file" default="$(find coverage)/maps/incubateur.yaml"/>

  <!-- Run the map server -->
  <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

  <!-- Run stage -->
  <node pkg="stage_ros" type="stageros" name="stageros" args="$(find coverage)/worlds/incubateur.world" respawn="false">
    <param name="base_watchdog_timeout" value="0.2"/>
  </node>

  <!-- Run rviz -->
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find coverage)/rviz_config.rviz" />

  <!-- Publish a static transformation between /map and /odom -->
  <node name="tf" pkg="tf" type="static_transform_publisher" args="12 7 0 -1.57 0 0 /map /odom 100" />

  <!-- Run coverage node -->
  <node name="coverage" pkg="coverage" type="coverage_node" output="screen" />
</launch>
edit retag flag offensive close merge delete