5.4.3.2
robot:move
robot:move {axis} {position} (#:time {time}) (#:speed {speed}) (#:placement {spatial|relative|absolute}) (counter)
This procedure is entirely compatible with the Level 2 robot:move command,
but adds an extra key movement-type argument which causes the position
argument to be interpreted in different ways. This means that programs
written against the Level 2 API will work identically if they use the Level 3
API.
Because of the nature of Scheme procedure definitions, if you want to specify
a movement-type you must also specify time and speed parameters; if you
want default behaviour with regard to these you can give their values as
#f.
- axis this should be a symbol from the set {base shoulder elbow
wrist-rotate wrist grip}, and indicates the axis to move.
- position this is the position to move the motor, in units of
degrees. Zero degrees corresponds in all cases to the mid position, and
motors will typically turn through +/- 90° though some are more
restricted. The exact meaning depends on the value of movement-type, but
if this is not present then the position is the absolution position to which
the motor will turn.
- time is the time in seconds in which the motion will take place.
- speed is the maximum speed in microsteps per second that will be applied
to the motors. A default value will be used if #f is given here.
- movement-type specifies how exactly the position request should be
enacted. The options are the symbols (equivalent strings are not
permitted)
- absolute, which will simply move the motor to the requested
position; this is the default if the parameter is not present
- space, which only works when axis is either wrist or elbow,
and places those joints into positions fixed in space; in both cases
0° corresponds to the components being horizontal (parallel to
the supporting plane), and increased angles correspond to upward
movements
- relative, which will add the position value to the current
position (as determined by the last move command) of the axis, and then
move the axis to that position
- parallel, which works exactly as relative except in the
special case of axis as shoulder, in which case the elbow will
simultaneously move contrary to the shoulder movement, or the case of
axis as elbow in which case the wrist will move contrary to the
elbow.
Examples
Before you do anything with the Level 3 API, you need to instantiate a robot
object to represent the device, and then you need to park it to ensure it is
in a well-known initial state:
(load "level-3.scm")
(use-modules (robot level 3))
(define robot (make-robot))
(robot:park robot)
Now you can make the robot do things. To get the forearm horizontal (in two
seconds),
(robot:move robot elbow 0 #:movement-type space #:time 2)
and the wrist
(robot:move robot wrist 0 #:movement-type space #:time 2)
Now move the shoulder forward 30°, keeping the entire forearm
horizontal,
(robot:move robot shoulder -30 #:movement-type parallel #:time 2)
And when youre finished playing, dont forget to put the robot back into the
neutral position, so that it will be well-behaved when it starts up again
(robot:park robot)
n