Ensayo Regimen Juridico
A first impression of programming with RoboMind
Arvid Halma, University of Amsterdam
Overview
●
Machines and Instructions Writing programs
●
Instructions
●
If youwant to make a machine, computer or robot work, you have to give it instructions Instructions differ from machine to machine and can be anything. For example:
– –
●
Video recorder: record, play,pause Web browser: go to site, go back, print page
●
Question: What could be instructions for an automatic pilot?
Basic instructions
●
Every machine has a set of basic instructions:actions it can perform directly. The robot we're going to program has basic instructions to:
●
Move
See
Paint
Grab
Giving instructions
●
Instructions can be given by
– – – –Pressing a button Dragging your mouse Writing commando's ...
Instructions with a mouse
●
Open the remote control in RoboMind
(Execute > Remote Control)
●
Click the buttons to make therobot act Exercise: Try to make the robot drive a small square
●
Writing instructions
●
You can also write instructions Moving can be done with the commands:
forward(1), backward(1), left(),right()
●
1. Write instructions 3. See the result
2. Click execute
Example: Square
●
Write the following movement instructions:
forward(1) right() forward(1) right() forward(1)right() forward(1) right()
Script 1
Writing seems slower
●
Writing instructions seems to be more work than using the remote controle However, it is more convenient if you want to automate theprocess of giving instructions
–
●
You can execute the instructions more than once, without writing the script again or clicking the buttons on the remote control Execution goes faster. You don'thave to find the buttons for giving instructions.
–
Extra instructions
●
Using extra instructions results in less typing Use for instance : repeat(number){instructions}
●
forward(1)...
Regístrate para leer el documento completo.