ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You have to use a stage model without sonar to use the laser sensor.
Attached you will find my cave-pionee.world which includes a working pioneer stage simulation. The background file cave.png must be in the same folder to get it working
# cave-pionee.world
# simple cave environment with a pioneer robot based on the basic world file examples of
# Richard Vaughan Richard Vaughan, Andrew Howard, Luis Riazuelo
# Authors: Markus Bader
define hokuyolaser ranger
(
sensor(
# laser-specific properties
# factory settings for LMS200
range [ 0.0 5.0 ]
fov 270.0
samples 270
)
model
(
# generic model properties
size [ 0.07 0.07 0.05 ] # dimensions from LMS200 data sheet
color "blue"
)
)
define my_block model
(
size [0.5 0.5 0.5]
gui_nose 0
)
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
laser_return 1
)
# set the resolution of the underlying raytrace model in meters
resolution 0.02
interval_sim 100 # simulation timestep in milliseconds
# configure the GUI window
window
(
size [ 635.000 666.000 ] # in pixels
scale 36.995 # pixels per meter
center [ -0.040 -0.274 ]
rotate [ 0 0 ]
show_data 1 # 1=on 0=off
)
# load an environment bitmap
floorplan
(
name "cave"
size [16.000 16.000 0.800]
pose [0 0 0 0]
bitmap "cave.png"
)
# set the resolution of
# throw in a robot
my_block( pose [ 5 4 0 180.000 ] color "green")
define pioneer_base position
(
color "red" # Default color.
drive "diff" # Differential steering model.
gui_nose 1 # Draw a nose on the robot so we can see which way it points
obstacle_return 1 # Can hit things.
ranger_return 0.5 # reflects sonar beams
blob_return 1 # Seen by blobfinders
fiducial_return 1 # Seen as "1" fiducial finders
localization "gps"
localization_origin [0 0 0 0] # Start odometry at (0, 0, 0).
# alternative odometric localization with simple error model
# localization "odom" # Change to "gps" to have impossibly perfect, global odometry
# odom_error [ 0.05 0.05 0.1 ] # Odometry error or slip in X, Y and Theta
# (Uniform random distribution)
# four DOF kinematics limits
# [ xmin xmax ymin ymax zmin zmax amin amax ]
velocity_bounds [-0.5 0.5 0 0 0 0 -90.0 90.0 ]
acceleration_bounds [-0.5 0.5 0 0 0 0 -90 90.0 ]
)
define pioneer2dx_base_no_sonar pioneer_base
(
# actual size
size [0.44 0.38 0.22] # sizes from MobileRobots' web site
# the pioneer's center of rotation is offset from its center of area
origin [-0.04 0 0 0]
# draw a nose on the robot so we can see which way it points
gui_nose 1
# estimated mass in KG
mass 23.0
# differential steering model
drive "diff"
)
# as above, but with front sonar only
define pioneer2dx_no_sonar pioneer2dx_base_no_sonar
(
# simplified Body shape:
block(
points 8
point[0] [-0.2 0.12]
point[1] [-0.2 -0.12]
point[2] [-0.12 -0.2555]
point[3] [0.12 -0.2555]
point[4] [0.2 -0.12]
point[5] [0.2 0.12]
point[6] [0.12 0.2555]
point[7] [-0.12 0.2555]
z [0 0.22]
)
)
pioneer2dx_no_sonar
(
# can refer to the robot by this name
name "r0"
pose [ -7 -7 0 45 ]
hokuyolaser(pose [ 0.225 0.000 -0.15 0.000 ])
)