Hello, guys...
In the KAREL Reference Manual there is the example:
Code
PROGRAM testTPmotion
VAR
home_pos :XYZWPR
BEGIN
WRITE ('HOME POSITION is not recorded', CR)
WRITE ('RELEASing motion control to TP.', CR)
WRITE ('Please move robot to desired Perch Pos', CR)
-- Wait until the DEADMAN switch is HELD and
-- TP is TURNED ON to move robot from TP
--GOTO label_1
WHILE ((TPIN[248] = ON) OR (TPIN[247] = ON)) DO -- TPIN[247] TPIN[248] = Right/Left DEADMAN switch
WRITE TPPROMPT (CHR(128), CHR (137), 'Hold down the DEADMAN switch')
DELAY 500
ENDWHILE
--label_1::
-- Release motion control from the KAREL program to the
-- TP control. Robot can be moved to desired Perch
-- position with out disturbing the flow of this KAREL task.
RELEASE
WHILE (TPIN[249] = OFF) DO -- TPIN[249] = ON/OFF switch
WRITE TPPROMPT (CHR(128), CHR(137), 'Turn OFF TP after move is done')
DELAY 1000
ENDWHILE
-- KAREL program execution will not continue passed ATACH
-- statement until the TP is turned OFF
-- Wait until the TP is TURNED OFF after move from TP is completed
WHILE (TPIN[249] = ON) DO
DELAY 2000
ENDWHILE
-- At this point the robot is positioned to the desired
-- Perch position. Get the motion control back
-- from TP and recored the perch position
ATTACH
home_pos = CURPOS (0, 0, 1)
END testTPmotion
Display More
According to this example, as I understand, when robot is in AUTO mode and this program is running, if perch position is not recorded, under some conditions I can turn TP off and move the robot.
Did somebody try this program? Today I did it, but when turning TP on I have the error message: "TP enabled in AUTO mode".
What's wrong with this example? Or may be I got this program wrong?