Download presentation
Published byLilian Farmer Modified over 9 years ago
1
iRobot Create Introduction Assembled from various online resources
mainly slides and pictures from Rob Kremer and Jamie Snape
2
Anatomy 22/04/2017 2
3
Anatomy Bump Sensors 22/04/2017 3
4
Anatomy 22/04/2017 4
5
Overview Based on Roomba robotic vacuum cleaner
Programmable with open interface of over 100 commands 32 internal and external sensors including bumpers and infrared Expansion port to add microcontroller, Bluetooth, and/or additional sensors
6
Programming (Bluetooth)
Send Open Interface commands via a virtual serial port: baud, 8 data bits, 1 stop bit Linux stty –F /dev/ttyUSB cs8 -cstopb Receive sensor data back as packets Using any scripting language (Perl, Python, etc.) Drive Create forward (OI script): (Start in safe mode) (Drive forward 100 mm/s)
7
Modes OFF PASSIVE SAFE may be recommended FULL
Unresponsive (except START (128)) Can charge PASSIVE Sensor status commands No Actuator commands SAFE may be recommended Actuator commands But reverts to PASSIVE if moving forward and any cliff sensor is activated; any wheel drop sensor is activated; or the charger is plugged in No Charging FULL 22/04/2017 7
8
Modes OFF PASSIVE SAFE FULL START (128) SAFE (131) FULL (132)
22/04/2017 8
9
Modes: WAIT A 5th Mode: WAIT
When in WAIT mode the robot does not respond to ANY input. Goes into WAIT mode for 3 commands (see WAIT slide): WAIT-DISTANCE WAIT-ANGLE WAIT-TIME WAIT-EVENT If the robot is prevented, for some reason, from traveling the distance or the angle, it won’t respond to anything (try the undocumented command 7). Use only in scripts, NOT RECOMMENDED 22/04/2017 9
10
Programming (Microprocessor)
Command Module plugs into expansion port 8-bit RISC microprocessor (~18 MHz) Upload C programs that send Open Interface commands and read sensor data Open source toolkit (Windows/Mac compatible) Four extra expansion ports to add custom hardware (sensors, LCD display, etc.)
11
Programming (Microprocessor)
Drive Create with specified velocity and radius (C function): void drive(int16_t velocity, int16_t radius) { byteTx(CmdDrive); byteTx((uint8_t)((velocity >> 8) & 0x00FF)); byteTx((uint8_t)(velocity & 0x00FF)); byteTx((uint8_t)((radius >> 8) & 0x00FF)); byteTx((uint8_t)(radius & 0x00FF)); }
12
Actuators: Drive DRIVE (137 <velocityhigh> <velocitylow> <radiushigh> <radiuslow>) 2 short (16 bit) parameters Each represented by 2 bytes, high byte first (so a total of 5 bytes for this command) Parameter 1: velocity in mm/sec -500 to +500 (-ve means “backwards”) Parameter 2: curve radius in mm -2000 to where -ve means clockwise and +ve means counterclockwise 32768 means “go straight” -1 and +1 mean spin in place clockwise, counterclockwise respectively 22/04/2017 12
13
Actuators: LEDs LEDs (139 <Adv&Play> <powerColor> <powerInten>) Adv&Play: Bit 1 (=2): Play LED Bit 3 (=8): Advance LED PowerColor (0-255): 0=green; 255=red PowerIntensity (0-255) 0=off; 255=full intensity 22/04/2017 13
14
Actuators: Send IR SEND-IR (151 <IRbyte>)
Sends a byte using an add-on circuit and a IR LED Can be received by the omnidirectional IR receiver at the front of the robot Could be use to transmit short-distance identifiers for each robot 22/04/2017 14
15
Actuators: Songs Load a song Play a song
140 <song#> <length> {<note> <duration>}* <song#>: 0-15 <length>: number of notes (1/2 of bytes) (up to 16 notes) <note>: see table in OI Manual <duration>: in 1/64 second … Play a song 141 <song#> Doesn’t work if a song is already playing 22/04/2017 15
16
Inputs: Sensors Read Sensors Also a commands for: 142 <packetID>
Packets 0-6 are “packet groups” (eg: 0 is sensors 7-26, which is 26 bytes [some are two-byte returns]) Packets 7-42 are individual sensors Either numerical values (1 or 2 bytes) or bitmaps See OI Manual Also a commands for: reading a list of sensors (149) requesting a continuous stream of packet data (148) pausing/resuming a stream (150) 22/04/2017 16
17
Sensor Groups Packets 22/04/2017 17
18
Sensor Single Packets 22/04/2017 18
19
Scripts Load a script Play a script Show script
152 <length> <opcode>* <length>: number of bytes in script (up to 100) <opcode>: OI commands Play a script 143 No flow control except for WAIT commands (next slide) Infinite cycle if script ends with 143 Show script 154 Returns the current script 22/04/2017 19
20
Scripts: Wait Wait time Wait Distance Wait Angle Wait Event
<time> in 1/10 sec (resolution of 15ms) Wait Distance 156 <disthigh> <distlow> <dist> distance in mm. +ve=forward, -ve=back Works for passively rotating the wheels Wait Angle 157 <anglehigh> <anglelow> <angle> angle in deg. +ve=counterclockwise, -ve=clockwise Wait Event 158 <event#> <event#>: eg: 1=wheel drop (see table in OI Manual, p.16) Use -ve for inverse of event (eg: -1 wheel drop stops) 22/04/2017 20
21
Tasks: measuring You can track the distance traveled by using sensor 19 (distance) Angle with sensor 20 (angle) Note: reading these sensors causes them to be reset Distance (angles) increment for forward (counterclockwise) and decrement for backward (clockwise) Class iRobotCreate’s regular sensor reading keeps an accumulator for distance and angle 22/04/2017 21
22
Tasks: Following a wall
You can track along a wall using the wall sensor (sensor 8) Use Drive straight (137 <velocity> 32687) when the wall is there; or a wide right curve (137 <velocity> -2000) when the wall goes away You should expect the occasional right-bump If you get a left-bump, you’ve probably hit a corner 22/04/2017 22
23
Commands from shell stty -F /dev/ttyUSB0 57600 cs8 –cstopb
echo -e '\0200\0204' | cat > /dev/ttyUSB0 (full mode) echo -e -n '\0214\0000\0004\0076\0014\0102\0014\0107\0014\0112\0044\r\n' | cat > /dev/ttyUSB0 (defines song) echo -e -n '\0215\0000\r\n' | cat > /dev/ttyUSB0 (plays song) echo -e -n '\0200\0203' | cat > /dev/ttyUSB0 (start move) echo -e -n '\0211\0000\0144\0200\0000' | cat > /dev/ttyUSB0 (go)
24
Further Reading iRobot Create http://www.irobot.com/sp.cfm?pageid=305
Manuals and downloads
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.