The mpro package provides programs and libraries for network-based
control of an iRobot MagellanPro robot. Included are programs for
on-board control of the robot, remote control, simulation, and more,
along with a client library for writing robot controllers that run
off-board the robot. mpro was designed to be used in teaching
activities but is also be useful for research.
Download mpro
mpro is provided in source code form only. For instructions on
compiling and installing the programs and library, read the
INSTALL
file that is included in the distribution. For
instruction on using mpro, read the README
file or this
website.
Current version: 0.1.8 (4/8/2006)
NOTE: If you need help with mpro, you can email me.
However, I do not guarantee any kind of response, as I am usually
too busy playing with robots.
NOTE 2: If you find bugs in mpro, please let me know.
Ideally, please send me code to fix the bugs! Do the same if you
add features.
Overview
The iRobot MagellanPro is a research robot with a differential
drive system, 16 bump sensors, 16 infrared range sensors, and 16
sonar range sensors. (iRobot no longer builds or supports these
robots.) The mpro package provides support for writing software to
control a MagellanPro and can be used on both *nix based and Windows
based systems. It includes the following:
- mprosim: A simulator. Any program you write with the
mpro client library can be run with both the simulator and a real
robot. Since mpro is network based, you can run the simulator on a
different computer than your client program if you wish. The
simulator takes a number of command line arguments to specify
worlds, robot properties, and so on. (Alternatively, these can be
specified in a configuration file. To get a default configuration
file, run mprosim --save-config default.conf.) Simulated "worlds"
are represented with simple PGM (image) files where dark pixels are
"occupied" and light pixels are "unoccupied." The simulation runs
at a reasonably high frequency and reasonably simulates odometry,
IR, and sonar noise. Note that the simulator does not display any
graphical output, so it can be run in the background.
- mprogui: A simple GUI for the simulator or Magellan. By
default, the GUI connects to "localhost" (i.e., it assumes there is
a simulator running on the same computer). You can specify a
different location with "mprogui -h hostname". For example, to
display the state of the real robot (at RPI), use "mprogui -h
magellanpro.robotics.cs.rpi.edu". If the GUI is showing a simulated
robot, it also displays the simulated world in which the robot is
situated. The displayed configuration of the robot is that reported
by its (noisy) odometry, but the true configuration of the robot is
also displayed (as a "semi-transparent" robot). The GUI supports a
number of keyboard commands: press 'h' in the GUI to list the
commands on the console. You can also use the mouse to pan (left
button pressed) or zoom (right button pressed) in the GUI.
- mproremote: A simple remote control program. It
displays a box containing "crosshairs". The horizontal axis
controls the robot's rotational velocity, and the vertical axis
controls its translational velocity. To move the robot, click (with
the left mouse button) on the origin of the axes, and then drag the
mouse (up to move forward, down backward, left to turn left, right
to turn right). When the mouse is released, the robot stops. By
default, mproremote connects to "localhost" but you can connect to,
e.g., the real robot with "mproremote -h
magellanpro.robotics.cs.rpi.edu".
- mproshutdown: A remote shutdown command. This has no
effect on a simulator. Instead, it shuts down the computer on the
real robot. Only use this when you are done working on the robot.
Just run "mproshutdown" (it connects to RPI's Magellan by default).
- libmproclient: You can write programs that control a
simulated or real robot by including "mproclient.h" and linking
against the mproclient library. In general you will probably find
it useful to accept a command line option specifying the host to
connect to, so that the same program can be run in simulation or on
the real robot without recompiling.
- mprod: A server daemon that runs on a MagellanPro robot.
The server listens for connections from libmproclient based clients
and then controls the robot or transfers data according to client
commands. The server is built on top of a version of the MAGE
library for on-robot control of the MagellanPro. MAGE was developed
by Nathaniel Fairfield at Swarthmore. We have modified MAGE
slightly to improve its infrared sensor model. The modified
version, Mage-0.31, is available from Nathaniel
Fairfield's site or from here.
Example session
Following is an example session showing a series of commands that
you can try in order to familiarize yourself with mpro. This
assumes you are using a Unix-based operating system (the '&' signs
run programs in the background). In Windows you may need to use a
separate command shell for each program. It also assumes the
programs have been installed somewhere in your path.
# run the simulator in the background with the test map (provided in
# the distribution in the data directory).
mprosim --map data/test.pgm --pixels-per-meter 40 &
# run the gui, which connects to your computer by default
mprogui &
# run the remote control program
mproremote
# now drive the robot around a bit, then press 'q' to quit
# compile the example programs and then run move-until-ir, which
# connects to localhost by default
cd examples
make
./move-until-ir
# quit the GUI by pressing 'q', and terminate the simulator with:
killall mprosim
# now let's try the same thing on a real robot
mprogui -h magellanpro.robotics.cs.rpi.edu &
mproremote
# when you get bored, do:
./move-until-ir magellanpro.robotics.cs.rpi.edu
# now write your own programs!