Sie sind auf Seite 1von 5

22c:161: Robotics I

Val II Commands
Daniel E. Stevenson

February 10, 1994

This is a list of simple Val II commands to program Raven.

1 The Val Monitor


The rst thing you must do is to start the robotalk program. To do this just type
\robotalk" from any unix shell on shaka. Once you have gone through the initialization procedure (see previous handout), you will get a \." prompt. When you are at
this prompt you are in the \val monitor."
Actually, you are running an interface via a serial port on the back of shaka to
the val monitor. The val monitor lives in a black box in the robot rack and runs on
(I think) a 68000 chip with limited memory. It also has direct access to a 5 1/4 disk
drive (which we almost never use).
So, at this point you may enter robotalk commands, enter Val II monitor commands, execute Val II programs, or start the Val II editor.
Note that Raven uses Val II and Fish uses Val I. The following commands are for
Raven only, but the Fish uses similar commands (see the Val II and Val I users guides
on the bookshelf in B1C for more information on both Val I and Val II).

2 Robotalk Commands
These are special commands the robotalk interface program intercepts and executes
before sending them to the robot. The current list includes:
1

22c161 Val II Commands




pload \ lename" | loads a Val II program into robot memory. This is a very
useful command because it means you can write your Val II code using emacs
(or any other inferior unix editor) and save your code on caesar's lesystem.
Then when you run your program you can upload your code into robot memory
and execute it directly. This saves you from having to use Val's line editor and
5 1/4 disk drive to write and save programs. Note that the double quotes need
to be present!
quit | causes the robotalk interface program to quit.

3 Val II Monitor Commands


Below I list some useful Val II commands. Most of these commands can be used
in the form below in Val II programs. However, some of them must be proceeded
by a \do" if executed directly from the \." prompt. For example, \move" must be
proceeded by a \do" (e.g. \do move location").

3.1 Operating System












plist [ lename] | list all [or optionally only one] program stored in val memory.
pdelete lename | deletes a program from active val memory.
llist | lists the de ned location variables. Please note that all location (and
real) variables are globally de ned except when speci ed to be local during
executing a Val II program.
ldelete varname | deletes a location variable from active val memory.
rlist | lists the de ned real variables.
rdelete varname | deletes a real variable from active val memory.
here varname | de nes a location variable to be the current robot position.
When it asked you for \Change?" just type return.
where | tells you the current robot position.

3.2 Movement


speed 50 always | sets the robot speed to some number (50 in this case). Don't
set this too high unless you know your program works! Set it low to debug your

22c161 Val II Commands








programs. If the always is missing then it just sets the speed for the next move
command.
accel 38 always | sets the acceleration of the robot (38 in this case).
decel 38 always | sets the deceleration of the robot (38 in this case).
move varname | this moves the robot to the position speci ed by the given
location variable. This may not move exactly in a straight line.
moves varname | same as move, but it moves in a straight line.
move varname:varname:...:varname | moves the robot to a new location speci ed by the transformations given. That is, this is a relative move.
break | can be used directly after a move in a val program to make the program
wait until that move is nished. Otherwise if you have two moves back to back,
the second one will start before the rst one is done and the tool may never
fully reach its rst destination.

3.3 Location variables















set varname1 = varname2 | this sets one location variable 1 to the location of
another, 2.
trans(x,y,z,o,a,t) | this forms a transformation matrix (a location variable)
where x,y and z are in mm and o,a and t represent the orientation of the tool.
decompose varname1[] = varname2 | this decomposes the location 2 into its 6
parts and stores them in varname1[0]...varname1[5] (that is, an array).
dx(varname) | extracts of the x component of a location.
dy(varname) | extracts of the y component of a location.
dz(varname) | extracts of the z component of a location.
ro(varname) | extracts of the o component of a location.
ra(varname) | extracts of the a component of a location.
rt(varname) | extracts of the t component of a location.
rx(number) | forms a rotation matrix
ry(number) | forms a rotation matrix
rz(number) | forms a rotation matrix

22c161 Val II Commands

3.4 Grippers




closei 1 | closes the gripper.


openi 1 | opens the gripper.
bits s,l = v | sets the value of \l" switches starting from number \s" to the
value \v". For example bits 4,1 = 0 turns o switch 4. These switches are
the I/O modules at the top of the robot rack and various things (light, slide
projectors, feeders, etc.) can be hooked up to them.

3.5 Etc.



+ - * / | these all work like the usual math functions.


There are many more commands that can be found in the users guide.

4 Val II Programs
Val II programs essentially look like a list of Val II monitor commands with a
.PROGRAM name (arg1,arg2,...)
at the start and a
.END
and the end.
Comments are lines started with a semicolon.
To execute a program called \test" with 1 parameter in val memory type either:



execute test(varname)
ex test(varname)

Here is a sample program (note also that certain programming constructs like
if..then statements, for loops, and arrays exist):
.PROGRAM test(l1)
; de ne two local variables, one of them an array
local l2,l3[]

22c161 Val II Commands

; set to a slow speed


SPEED 30 ALWAYS
; decompose the input location, l1, into its 6 parts
DECOMPOSE l3[] = l1
; de ne location l2 to be the same as location l1 except that the
; x,y and z components have all been increased by 5mm each
set l2 = trans(l3[0] + 5, l3[1] + 5, l3[2] + 5, l3[3], l3[4], l3[5])
; move to the new location
moves l2
break
.END

5 Val II Editor
Val II has a line editor. It is hard to use and you have to save your programs on the 5
1/4 disk drive. The pload (robotalk) command renders the val editor almost useless.
However, if you wish to explore the editor look up the \edit" command in the Val II
users guide.

Das könnte Ihnen auch gefallen