Roger-the-Crab
Rod Grupen
Department of Computer Science
University of Massachusetts Amherst
Laboratory for Perceptual Robotics – Department of Computer Science
Un-Crating your Roger - C and X windows
Platforms:
• EdLab under Linux (anyone?)
• OS X, Linux, Windows + VM/Linux
Getting Started:
• download your copy of the Roger simulator from
www-robotics.cs.umass.edu/~grupen/603/code
• unpack the compressed tar/zip file:
> tar -xvf RogerSimProjects.tar
• descend into the RogerSimulator subdirectory:
> make clean; make <CR>
• copy lib/simulator.a file to ../RogerProjects/lib/
• in RogerProjects directory:
> make clean; make <CR>
> ./x <CR>
Laboratory for Perceptual Robotics – Department of Computer Science
2
cut to working simulator!
Laboratory for Perceptual Robotics – Department of Computer Science
3
The Simulator Environment
Laboratory for Perceptual Robotics – Department of Computer Science
4
The Simulator Environment
Laboratory for Perceptual Robotics – Department of Computer Science
5
Input Modes: Joint Angle inputs
+π!
configuration
space!
(q1)
right
button!
left (q1,q2)
button!
-π!
Laboratory for Perceptual Robotics – Department of Computer Science
-π!
+π!
6
Input Modes: Base goals
Input: Base goal
!
Cartesian
space!
(x,y)
world frame!
Laboratory for Perceptual Robotics – Department of Computer Science
7
Input Modes: Arm goals
!
Input: Arm goals
Cartesian
space!
right arm!
right
button
(x,y)
left
button
(x,y)
left arm!
world frame!
Laboratory for Perceptual Robotics – Department of Computer Science
8
Input Modes: Introducing an Object (Ball)
!
Input: Ball position
Cartesian
space!
world
frame!
Laboratory for Perceptual Robotics – Department of Computer Science
9
Input Modes: Map Editor
Input: Map editor
!
obstacles
goals
Laboratory for Perceptual Robotics – Department of Computer Science
10
Control Modes
Project-specific control
!
Laboratory for Perceptual Robotics – Department of Computer Science
11
Environmental Maps
different rooms!
Laboratory for Perceptual Robotics – Department of Computer Science
12
Command line I/O
accurate setpoints, gains, etc!
Laboratory for Perceptual Robotics – Department of Computer Science
13
Project Specific Visualization
Project/user defined tools
location uncertainty
path plans
potential maps
Laboratory for Perceptual Robotics – Department of Computer Science
14
Quiting the Simulator
Laboratory for Perceptual Robotics – Department of Computer Science
15
Roger-the-Crab - Kinematic Definition
./include/roger.h!
Laboratory for Perceptual Robotics – Department of Computer Science
16
Afferents
eyes:
.!
• θ[2], θ[2], images[2][128][3]
R2
U!
arms:
.!
.!
• θ1[2], θ1[2], θ2[2], θ2[2]
• tactile (force) sensors: f[2]
U!
mobile base:
.!
.!
.!
• position (x, x, y, y), orientation (θ, θ)
• bump (force) sensor: f R2
Laboratory for Perceptual Robotics – Department of Computer Science
17
Efferents
eye torques:
• τ[2]
arm torques:
• τ1[2], τ2[2]
mobile base:
• wheel torques τ[2]
Laboratory for Perceptual Robotics – Department of Computer Science
18
Robot Interface: Project #1, #2
• eye joint angles/velocities
• images
always!
on!
• arm joint angles/velocities
• tactile (force) sensors
• base position (x,y), orientation (θ)
• bump (force) sensor
applications
(MotorUnits.c)!
simulator
• eye motor torques
• arm motor torques
• wheel torques
Laboratory for Perceptual Robotics – Department of Computer Science
19
Control Interface - control.h
typedef struct Robot_interface {
// SENSORS
double eye_theta[NEYES];
double eye_theta_dot[NEYES];
int image[NEYES][NPIXELS][NPRIMARY_COLORS]; /* rgb */
double arm_theta[NARMS][NARM_JOINTS];
double arm_theta_dot[NARMS][NARM_JOINTS];
double ext_force[NARMS][2];
/* (fx,fy) force on arm endpoint */
double base_position[3];
/* x,y,theta */
double base_velocity[3];
// MOTORS
double eye_torque[NEYES];
double arm_torque[NARMS][NARM_JOINTS];
double wheel_torque[NWHEELS];
// TELEOPERATOR
int button_event;
double button_reference[2];
typedef struct _map {
int occupancy_map[NBINS][NBINS];
double potential_map[NBINS][NBINS];
int color_map[NBINS][NBINS];
} Map;
// CONTROL MODE
int control_mode;
int input_mode;
Map world_map, arm_map[NARMS];
// REFERENCE VALUE
double base_setpoint[3];
double arm_setpoint[NARMS][NARM_JOINTS];
double eyes_setpoint[NEYES];
} Robot;
/* desired world frame base position (x,y,theta) */
/* desired arm joint angles */
/* desired eye pan angle */
Laboratory for Perceptual Robotics – Department of Computer Science
20
Hierarchical Control
Laboratory for Perceptual Robotics – Department of Computer Science
21
MotorUnits.c
current
sensory
state
simulator
_!
Σ!
+!
higher-level
reference
inputs
control_roger()
control_base()
control_arms()
control_eyes()
control
torques
Laboratory for Perceptual Robotics – Department of Computer Science
22
Cumulative Project Work
1.
2.
3.
4.
5.
6.
motor units!
Cartesian goals!
oculomotor behavior!
visual reconstruction - triangulation!
“hunting” - integrated behavior!
…!
options:!
1. path planning!
2. learning!
3. Pong!
4. …!
!
Laboratory for Perceptual Robotics – Department of Computer Science
23
© Copyright 2026 Paperzz