Top Banner
Chapter 1 B21R Overview This Chapter gives a broad overview of the iRobot B21R Mobile Robot. 1.1 Hardware 1.1.1 CPU The 1.1.2 Drive The B21R 1.1.3 Wireless The B21R’s connection to the outside world is via a wireless local area network (WLAN). The hardware associated with this connection onboard the B21R is a network interface card (NIC) installed in the robot’s CPU. This provides a standard “wired” network connection to the CPU. To achieve a wireless connection to the WLAN, the NIC is connected to an “ethernet bridge” which transparently converts the wired signal to wireless to communicate with the WLAN. From the point of view of the B21R, it has a simple wired connection to the labo- ratory’s network 1.1.4 Camera The B21R has an onboard Pan-Tilt-Zoom camera 1.1.5 LADAR (Laser Rangefinder) The B21R’s main sensor is the SICK Laser Rangefinder. This sensor is a time-of-flight infrared laser rangefinder, which resolves distance and bearing to objects in the environment 1
20

Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

Jul 05, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

Chapter 1

B21R Overview

This Chapter gives a broad overview of the iRobot B21R Mobile Robot.

1.1 Hardware

1.1.1 CPU

The

1.1.2 Drive

The B21R

1.1.3 Wireless

The B21R’s connection to the outside world is via a wireless local area network (WLAN).The hardware associated with this connection onboard the B21R is a network interface card(NIC) installed in the robot’s CPU. This provides a standard “wired” network connectionto the CPU.

To achieve a wireless connection to the WLAN, the NIC is connected to an “ethernetbridge” which transparently converts the wired signal to wireless to communicate with theWLAN. From the point of view of the B21R, it has a simple wired connection to the labo-ratory’s network

1.1.4 Camera

The B21R has an onboard Pan-Tilt-Zoom camera

1.1.5 LADAR (Laser Rangefinder)

The B21R’s main sensor is the SICK Laser Rangefinder. This sensor is a time-of-flightinfrared laser rangefinder, which resolves distance and bearing to objects in the environment

1

Page 2: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

Figure 1.1: Diagram of the SICK LADAR Sensor.

to 1◦ and 5cm increments. This sensor has a sensing range of 50m in a semicircle aroundthe sensor (see Fig 1.1.

1.2 Software

1.2.1 Interfaces

1.2.2 MOM

MOM (Mobility Object Manager) is a graphical program which runs onIn order for MOM to access the sensors on a robot, MOM

1.2.3 Environment Variables

1.2.4 Wireless Configuration

2

Page 3: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

Figure 1.2: Wireless Access Point Login.

Figure 1.3: Wireless Access Point Main Configuation Screen.

3

Page 4: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

Chapter 2

Programming

All programming and program execution is generally done locally on the robot, which isaccessible by ssh from one of the IML laptops or computers (eg. dr-theopolis, deep-thought,iml2). Connection to the onboard CPU is done via a private 802.11b/g wireless networkinstalled in the IML workspace. Chapter ?? also describes how to connect to the CPU viaserial modem when the wireless network is unavailable.

Programs for the robot are written in C++ and require several libraries provided byiRobot. It is the extensive nature of these libraries which makes ??? to do all developmentand compiling locally on the robot, since recreating the library structure remotely has provento be too much of a problem to be worth it in the past.

2.1 include Files

Examples of C++ programs written for the robots can be found in the directory /mobility/mobility-b-1.1.8nb/mby/examples.The directory /mobility/mobility-b-1.1.8nb/include

2.2 Environment Variables

The Mobility c© software interfaces require certain Linux environment variables to be set (de-tailed information on the interfaces and environment variables can be found in the Mobility c©

Robot Integration Software User’s Guide provided by iRobot.The required environment variables are set in the .bashrc file, which lives in the root

directory of the user “mobility” on the robot’s onboard CPU.

export MOBILITY_ROOT=~/mobility-b-1.1.8nb

export MOBILITY_NS=http://bender/~mobility/NamingService

export MOBILITY_DRIVE_PATH=’bender/Drive’

export MOBILITY_SONAR_PATH=’bender/Sonar’

export MOBILITY_LASER_PATH=’bender_laser’

export MOBILITY_PTZ_PATH=’bender_PTZ’

export MOBILITY_FRAMEGRABBER_PATH=’bender_framegrabber’

export MOBILITY_COMPASS_PATH=’bender_compass’

4

Page 5: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

export NETPBM=$HOME/netpbm-10.18.15

export PATH=$PATH:$NETPBM/converter/ppm:$NETPBM/converter/other:$NETPBM/editor

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NETPBM/lib

export CPLUS_INCLUDE_PATH=$HOME

2.3 Compiling

Compiling programs for the robot requires

2.4 Random Things To Know

The Mobility c©

5

Page 6: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

Chapter 3

Initialization

3.1 SSH

Protocol: ssh2 Hostname: 192.168.1.21 Port: 22 Username: mobility Password: atwJsaSj

3.2 Starting Name Server

name -r

3.3 Starting Interfaces

b21rserver -name benderssh -f bender pls server -deviceport /dev/ttyR3 -name bender laserssh -f bender ptzserver -name bender PTZssh -f bender v4lserver -deviceport /dev/video0 -name bender framegrabber

3.4 Using MOM

# .bashrc

# User specific aliases and functions

# Source global definitions

if [ -f /etc/bashrc ]; then

. /etc/bashrc

fi

export MOBILITY_ROOT=~/mobility-b-1.1.8nb

#export MOBILITY_NS=http://‘hostname -s‘/~atuls/NamingService

export MOBILITY_NS=http://bender/~mobility/NamingService

6

Page 7: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

alias base=’b21rserver -name $HOSTNAME’

alias pantilt=’ptzserver -deviceport /dev/ttyR1 -name ‘hostname -s‘_pantilt’

alias absoluteorientation=’compass-server -deviceport /dev/ttyR2 -name ‘hostname -s‘_absoluteorientation’

alias laser=’pls_server -deviceport /dev/ttyR3 -name ‘hostname -s‘_laser’

alias crossbow=’dmuserver -deviceport /dev/ttyR4 -name ‘hostname -s‘_crossbow’

alias dgps=’dgpsremoteserver -deviceport /dev/ttyR5 -name ‘hostname -s‘_dgps’

alias framegrab0=’v4lserver -deviceport /dev/video0 -name ‘hostname -s‘_camera’

alias ptz=’cd my-ptz && ./ptzserver -name bender-PTZ’

alias murid=’cd MURI-demo/tracking-iPAQ && ./lasertracker -robot bender -laser bender_laser -ptu bender-PTZ -k1 0.12’

if [ -f $MOBILITY_ROOT/etc/setup ]; then

source $MOBILITY_ROOT/etc/setup

fi

alias rm=’rm -i’

alias ls=’ls --color=always’

alias e=’emacs -nw’

alias printenv=’printenv | sort’

# Added by HMS, 7/15/04

export MOBILITY_DRIVE_PATH=’bender/Drive’

export MOBILITY_SONAR_PATH=’bender/Sonar’

export MOBILITY_LASER_PATH=’bender_laser’

export MOBILITY_PTZ_PATH=’bender_PTZ’

export MOBILITY_FRAMEGRABBER_PATH=’bender_framegrabber’

export MOBILITY_COMPASS_PATH=’bender_compass’

#alias laser=’pls_server -deviceport /dev/ttyR3 -name $MOBILITY_LASER_PATH’

export NETPBM=$HOME/netpbm-10.18.15

export PATH=$PATH:$NETPBM/converter/ppm:$NETPBM/converter/other:$NETPBM/editor

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NETPBM/lib

export CPLUS_INCLUDE_PATH=$HOME

##

7

Page 8: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

export PATH=$PATH:$HOME/hmsallum/benderCGI-GUI/misc

8

Page 9: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

Chapter 4

Running Programs

4.1 Command Line

4.2 Error Messages

seg faultbad array managementbad file associationinterface not turned onbad environment variable

9

Page 10: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

Chapter 5

Serial Login

In certain cases you may need to login to the CPU on the B21R directly, instead of viaa wireless connection. This occurs most frequently during startup, when there is an errorduring the linux file system check (fsck.ext2). When this happens you will need to performa serial login to the CPU.

In order to do this, you need to get to the CPU inside the B21R by opening up one ofthe body panels (see Fig. 5.1). This is done by pushing inward on the panel, then lifting up.The panel is hinged, and should now swing open exposing the rear of the CPU case inside.

Note: The following operation of connecting a cable from the robot to acomputer can be performed while the CPU is running, but if possible it is bestto do this while the CPU is off.

Next, the RFlex Display, which is the onboard I/O for the CPU, must be disconnectedfrom the serial port on the CPU. Fig. 5.2 shows the RFlex’s blue plastic connector attachedto the CPU’s serial port. This connector must be removed (Fig. 5.3) and a 9-pin D-sub serialcable connected to the port in its place (Fig. 5.4). This cable must either be a Null-Modemcable, or a Null-Modem adapter must be attached to the cable.

10

Page 11: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

Figure 5.1: Bender With the CPU panelopen.

Figure 5.2: The RFlex Display Serial Con-nector

Figure 5.3: Removing the RFlex DisplaySerial Connector.

Figure 5.4: Connecting the 9-pin SerialNull-Modem Cable.

11

Page 12: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

Chapter 6

Support Information

SONY EVI-D30 Pan-Tilt-Zoom Camera Page:http://www.sony.net/Products/ISP/products/ptz/EVID30.htmlNOTE: This product is discontinued.

SICK PLS 101-312 Laser Scanner Page:http://www.sickusa.com/live/master/datasheet.asp?PN=1016066&FAM=SafeScan

Netgear WG602 v.2 Wireless Access Point Support Page:http://kbserver.netgear.com/products/WG602v2.asp

12

Page 13: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

Appendix A

IP and MAC Addresses

As mentioned before, the wireless network which the robots communicate over is a MAC-filtered static-IP (not DHCP) wireless network. The MAC addresses of the devices on eachlab machine (computer, PDA, robot) are listed below, along with each machine’s wirelessIP. NOTE: the MAC addresses of the Converters are not needed for setting up the MACfiltering on the Access Point, they are listed solely for reference.

Network SSID: “IML-wireless”

Machine MAC Address (Device) IP AddressAccess Point 00:09:5B:F6:E0:24 192.168.1.17

dr-theopolis 00:02:2D:36:41:27 192.168.1.24deep-thought 00:02:2D:7B:F8:4A 192.168.1.27iPAQ 1 00:02:8A:A0:9C:2E 192.168.1.28iPAQ 2 00:04:AC:6C:32:70 192.168.1.29iPAQ 3 00:02:8A:A0:B2:CC 192.168.1.30iPAQ 4 00:02:8A:A2:9E:DC 192.168.1.31iPAQ 5 00:02:8A:B7:6F:1C 192.168.1.32iPAQ 6 00:02:8A:A2:B8:35 192.168.1.33

bender 00:40:F4:6B:83:70 (NIC card) 192.168.1.2100:02:2D:18:22:D5 (Converter)

threepio 00:40:F4:6B:84:0C (NIC card) 192.168.1.2200:02:2D:8B:7F:4F (Converter)

cylon 00:02:2D:65:C8:76 (wvlan0) 192.168.1.18gort 00:02:2D:65:BC:EF (wvlan0) 192.168.1.19twiki 00:E0:4C:77:05:74 (NIC card) 192.168.1.23

00:02:2D:51:A1:72 (Converter)artoo 00:06:25:03:7D:8E 192.168.1.20

13

Page 14: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

Appendix B

C++ Programming

B.1 Function Header Files

B.1.1 geometry.h

bearing() This function returns the floating-point angle in radians between two points,given in the User-frame format.

dist() This function returns the floating-point distance between two points, given in theUser-frame format.

sign() This function performs the signum mathematical function.

round() This function performs a standard rounding function.

B.1.2 T-class.h

(class) T

newangle(offset, oldangle) This function

B.1.3 mapper.h

makeppm2( X[180 , Y[180])]

makeppm3( X[180 , Y[180])]

getRGBvects240x180()

getRGBvects240x220()

putRGBvects240x180()

putRGBvects240x220()

putsegment240x180()

14

Page 15: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

putsegment240x220()

putsegment240x180()

putsegment240x220()

putendpoint240x180()

putendpoint240x220()

B.1.4 segments.h

find objects() sfsgsfd

find segments() sdfgsdfg

perp dist() sdfgsdf

linefitp() sdfdfs

find lines() s dfs df

intersection() sdfg sdf g

find corners()

confidence()

find fiducials()

B.1.5 occupancy.h

carve480x480()

initialize occmap()

sample occmap()

getRGBvects480x480()

putRGBvects480x480()

15

Page 16: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

B.2 Robot Code

lasermap8.cpp This program takes in coordinates in asdf asdfa sdf asdf asdf

lasermap9.cpp

laserrotate.cpp This program takes in a

laserping.cpp

makemap0.cpp

makemap.cpp

makemap2.cpp

puttarget.cpp

putline.cpp

vidgrab.cpp

addlidar2.cpp

puttarget-image.cpp

B.3 Data Files

xydata.dat This file contains the raw LADAR data from the most recent laser rangefinderscan. The data is in local robot coordinates, and the robot’s pose at the time of thescan is specified at the head of the file.

The data in this file is used for generating all maps and LADAR/Vision fused images.

dots.dat This file contains intermittent samples of the robot’s position, in the globalcoordinate frame, taken during navigation. New data is appended to the end as newcommands are given to the robot. The file can be cleared by a command on the mainCGI screen.

objects.txt This file contains the output from the Object Detection data analysisprocess described in Section ??? of [1], applied to the most recent laser rangefinderscan.

segments.txt This file contains the output from the Segment Detection data analysisprocess described in Section ??? of [1], applied to the most recent laser rangefinderscan.

lines.txt This file contains the output from the Segment Linefitting data analysis processdescribed in Section ??? of [1], applied to the most recent laser rangefinder scan.

fiducials.txt This file contains the output from the entire data distillation processdescribed in Section ??? of [1], applied to the most recent laser rangefinder scan.

16

Page 17: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

B.4 Typical Mobility c© Program Sructure

“Mobility Program Template.cpp”

// These includes pull in interface definitions and utilities.

#include "mobilitycomponents_i.h"

#include "mobilitydata_i.h"

#include "mobilitygeometry_i.h"

#include "mobilityactuator_i.h"

#include "mobilityutil.h"

#include <iostream>

#include "T-class.h"

#include "geometry2.h"

// Define absolute X, Y, and angle as macros. These values will be

// (0m,0m,0rad) where the robot is initialized.

// Define the base X, Y, and angle as macros. These values will be

// (0m,0m,0rad) at the onset of the program.

#define ABSX Drive_data->position[0]

#define ABSY Drive_data->position[1]

#define ABSANG Drive_data->position[2]

#define BASEX ABSX-initXpos

#define BASEY ABSY-initYpos

#define BASEANG newangle(initAng,ABSANG)

// Define the frequently-used Mobility Interface commands as macros.

// - "GETDRIVESAMPLE" updates the "Drive_data" object will the most

// recent drive information (ie virtual encoder readings,

// instantaneous velocities, etc.)

// - "SENDDRIVECOMMAND" passes the velocity values in the "OurCommand"

// array to the Mobility Drive interface for commanding the robots

// motion.

#define GETDRIVESAMPLE Drive_data = Drive_state->get_sample(0)

#define SPEED OurCommand.velocity[0]

#define OMEGA OurCommand.velocity[1]

#define SENDDRIVECOMMAND pDriveCommand->new_sample(OurCommand,0)

#define SHOWBASEANG cout << "\nHeading: " << newangle(initAng,ABSANG)*180/PI

#define GETLASERSAMPLE pLaserSegData = pLaserSeg->get_sample(0)

17

Page 18: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

// Because of a very small angular drift ("straight" motion == ~28.2m

// radius circle), define a value "ZERO" to set the angular velocity

// when a straight line motion is desired:

#define ZERO 0 //speed/28.2

// ************ START OF MAIN PROGRAM ******************

int main (int argc, char *argv[]){

cout << "\n***************PROGRAM START******************\n";

// Initialize the Mobility pathnames and smart-pointers:

#include "MobilityInitCode.h"

#include "MobilityDriveCode.h"

//#include "MobilityLaserCode.h"

//#include "MobilityCameraCode.h"

// Get Drive state data

GETDRIVESAMPLE;

18

Page 19: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

Appendix C

CGI Scripting

C.1 Layout

Fig. illustrates the topology of the GUI developed for use with the iPAQ PDA.The B21R’s onboard web server ——Because there is no specific user account associated with the user “nobody”, several key

environment variables for the onboard Linux system must be defined at the beginning ofeach script (see Fig. ??). The declarations of these environment variables last only for theduration of the script’s runtime.

Below are the descriptions of the CGI scripts used in the GUI.

camera.pl:

command0.pl: This script takes in pixel coordinates from the 0.5m grid map image in“map0.pl”, converts them to local robot frame coordinates, and runs “lasermap9.cpp”with those coordinates. When “lasermap9.cpp” finishes running, the script directsthe browser back to “map0.pl”.

command.pl:

command2.pl:

commandping0.pl:

commandping.pl:

commandping2.pl:

eraselaserdata.pl:

index2.pl:

lidar.pl:

lidargrab.pl:

lidarmove.pl:

19

Page 20: Chapter 1 B21R Overvie · given in the User-frame format. dist() This function returns the floating-point distance between two points, given in the User-frame format. sign() This

lidartarget.pl:

makemap0.pl:

makemap.pl:

makemap2.pl:

map0.pl:

map.pl:

map2.pl:

rotateping.pl:

rotmap.pl:

C.2 Setting Environment Variables

$ENV{’HOSTNAME’}="bender";

$ENV{’PATH’}="/home/mobility/netpbm-10.18.15/converter/ppm:/home/mobility/hmsallum/lasermap6";

$ENV{’LD_LIBRARY_PATH’}="/home/mobility/mobility-b-1.1.8nb/lib:/home/mobility/mobility-b-1.1.8nb/tools/lib:/home/mobility/netpbm-10.18.15/lib";

$ENV{’MOBILITY_DRIVE_PATH’}="bender/Drive";

$ENV{’MOBILITY_SONAR_PATH’}="bender/Sonar";

$ENV{’MOBILITY_LASER_PATH’}="bender_laser";

$ENV{’MOBILITY_PTZ_PATH’}="bender_PTZ";

$ENV{’MOBILITY_FRAMEGRABBER_PATH’}="bender_framegrabber";

$ENV{’MOBILITY_COMPASS_PATH’}="bender_compass";

20