robolab tutorial
TRANSCRIPT
-
8/9/2019 Robolab Tutorial
1/4
ROBOLAB INTRODUCTIONMAE 1170
(I) Starting Out
We will be using ROBOLAB 2.5, a GUI-based programming sysem, o programrobos buil using !e Lego "indsorms #i. $!e brain o% !e robo is ami&ropro&essor &alled !e 'RCX( w!i&! a&&eps programs !roug! an IRransmier w!i&! s!ould be aa&!ed o your &ompuer.
)* Ge a yellow RCX &onroller and urn i on. +oi&e !e pors on !edei&e pors ), 2, / %or aa&!ing sensors and pors A, B, 0 %or aa&!ingmoors and lamps. $!ings aa&! o !e R01 using !e bla& &ables in youri.
2* 34amine !e in%rared ransmier w!i&! is &onne&ed o your 0. By
pla&ing !e ransmier a %ew in&!es in %ron o% !e RCX6s 'in%rared eye,( aprogram &an be ransmied wirelessly.
/* Using !e VIEW buon you &an dire&ly see alues o% !e sensors !ooedup o !e R01. Use !e PRORAM buon o &y&le !roug! !e 5 programslos and !i RUN o sar7sop !e program.
$ransmier
LongRange78!or
Range 8wi&!
9* +ow, &li& on ROBOLAB 2.5 under !e PRORAMS → ROBOLAB menu on !e8ar buon. 0li& on !e ROGRA""3R buon and double &li& onI+:3+$OR 9.
5* A large grap!i&s window opens up, and you will see a green light and ared light ;!is is !e DIARAM window), a functions palee wi! los o%buons and ano!er window on op o% !e grap!i&s window wi! insru&ions
-
8/9/2019 Robolab Tutorial
2/4
on !ow o reurn o !e main menu. 3ery program sars wi! a greenlight and ends wi! a red light.
-
8/9/2019 Robolab Tutorial
3/4
* Le6s sar by building a simple program. ress TAB unil you ge !e arrowool. Crag a 'moor A %orward( and 'moor 0 %orward( ob?e& o !e CIAGRA"window. +ow go o !e Wait !r window and pull in a 'wait for ! seconds(ob?e&. $!en, drag in a 'moor A reerse( and 'moor 0 sop sign.( Rig!now, your program s!ould loo some!ing lie !is>
Use !e spool ool o run a wire %rom !e "#$ o% !e green light o !e BEINo% !e 'moor A %orward( ob?e&. 8imilarly, wire eery!ing in !e seFuen&eoge!er unil !e red light. Go o !e M!,i-'r window and drag !e'power leel 2( ob?e& ne4 o all !e moor ob?e&s. Wire !e modiDer ob?e&ono !e appropriae slo on !e moor using !e spool ool.
$!e arrow in !e op le% o% !e diagram window s!ould now be solid. 8e up!e RCX and IR ransmier &orre&ly and &li& !e arrow o ransmi !eprogram. As a $A %or !elp i% you e4perien&e problems wi! !is sep. 0li&
38 i% i ass you i% you wan o use program slo / sin&e program ) and 2 arelo&ed. $ry ou !e programH Coes i do w!a you !in i s!ould
)J* +e4 we will up !e &omple4iy a bi and %amiliariKe you wi! !e basi&ools you will need o do !e lab. Celee spool lines in your &urren programby sele&ing !em wi! !e arrow and !iing delee.
0reae and rans%er !e program below. Ob?e&s you will need are !e 'loop(i&ons in !e Stru+tur' window and !e 'wai %or dar( and 'wai %or lig!(ob?e&s in !e Wait !r window. $!e 'numeri&al &onsan modiDer( &an be%ound in !e "odiDer window, and &an be edied using !e text ool. "aesure !e program wors &orre&ly and e4plain ea&! elemen o a $A be%oremoing o !e ne4 sep.
-
8/9/2019 Robolab Tutorial
4/4
))* As a Dnal e4ample, build !e simple looping program pi&ured below. Eind!e 'loop w!ile lig! sensor is less !an( loop in !e Stru+tur' window. Add!e sound ob?e&s %rom !e main functions palee and modi%y !em o !esounds o% your &!oosing. ou s!ould Dnd !a your R01 maes noisesw!eneer !e lig! sensor senses a w!ie sur%a&e, and !is be!aior repeasbe&ause o% !e loop.
(III) Pr!gra$$ing Strat'g/
Using a &ombinaion o% !e ools, you s!ould !ae no problem programming arobo o %ollow a bla& line. Bu insead o% diing dire&ly ino programming,use !is general sraegy>
)* I,'nti/ !e ey a&ions you wan your robo o per%orm.
2* Wrie '%'u,!+!,'2 in 3nglis! on a separae s!ee o spe&i%y !e sepso% your program. An e4ample o% pseudo-&ode would be !e %ollowing>
• "oors A and 0 on ;power leel /*
• Wai ill ou&! sensor is pressed ;por 2*
•
Reerse "oor A• $urn o= moor 0
/* E#'+ut' and build !e program in ROBOLAB using your pseudo-&ode as anouline.
9* Tr!u3&'4!!t5 Almos no programs wor &orre&ly on !e Drs ry.AnalyKe w!a is !appening ;Is !e robo oers!ooing Is one mooroerpowering !e o!er* and ieraiely per%e& your algori!m and7or robo.