Moving from Stage 3 to Stage 4: laser and ranger

I recently moved to a new laptop, and in the process of installing player/stage, I moved from Stage 3.2.2 to Stage 4.0.1.

When I tried running a project of mine, however, I got the following error:

jaustin@navi:~/dev/player-bots/voronoibot$ robot-player cfg/voronoi.cfg
Registering driver
Player v.3.0.2

* Part of the Player/Stage/Gazebo Project [http://playerstage.sourceforge.net].
* Copyright (C) 2000 - 2009 Brian Gerkey, Richard Vaughan, Andrew Howard,
* Nate Koenig, and contributors. Released under the GNU General Public License.
* Player comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
* are welcome to redistribute it under certain conditions; see COPYING
* for details.

invoking player_driver_init()...
 Stage driver plugin init
 
 ** Stage plugin v4.0.1 **
 * Part of the Player Project [http://playerstage.sourceforge.net]
 * Copyright 2000-2009 Richard Vaughan, Brian Gerkey and contributors.
 * Released under the GNU General Public License v2. 
 
success
 Stage plugin:  6665.simulation.0 is a Stage world
stall icon /usr/share/stage/assets/stall.png 
 [Loading cfg/lab.world][Include pioneer.inc][Include map.inc][Include sick.inc]f: cfg/lab.world
 
err: Model type laser not found in model typetable (/build/buildd/stage-4.0.1/libstage/world.cc CreateModel)
err: Unknown model type laser in world file. (/build/buildd/stage-4.0.1/libstage/world.cc CreateModel)

The model type laser is defined in a couple of configs I have, like so:

driver
( 
  name "stage"
  provides [ "position2d:0" "laser:0" "speech:0" "graphics2d:0" "graphics3d:0" ]
  model "r0" 
) 
define sicklaser laser
(
  # laser-specific properties
  # factory settings for LMS200
  range_max 8.0 
  fov 180.0 
  samples 361
  
  #samples 90 # still useful but much faster to compute
  
  # generic model properties
  color "blue"
  size [ 0.156 0.155 0.19 ] # dimensions from LMS200 data sheet
) 

At first I thought I had screwed up my stage installation, and was at the point where I was going to try to install from source. But then! I saw this in the README.txt file that is bundled with Stage 4 source:

Version 4.0.0
————-

Major new release since worldfile syntax and API have both changed due
to a new unified ranger model. Laser model is now deprecated in favour
of the ranger. This follows a similar change in Player 3, where laser
interface support was deprecated but still in place due to lack of
Stage support. This release fixes that.

So since “laser” has been replaced by “ranger”, I replaced those words in my config files as well:

driver
( 
  name "stage"
  provides [ "position2d:0" "ranger:0" "speech:0" "graphics2d:0" "graphics3d:0" ]
  model "r0" 
) 
define sicklaser ranger
(
  # laser-specific properties
  # factory settings for LMS200
  range_max 8.0 
  fov 180.0 
  samples 361
  
  #samples 90 # still useful but much faster to compute
  
  # generic model properties
  color "blue"
  size [ 0.156 0.155 0.19 ] # dimensions from LMS200 data sheet
) 

And it worked!