#include <rccl.h>
#include "manex.560.h"

main()
{
        TRSF_PTR p, t;                                          /*1*/
        POS_PTR pos;                                            /*2*/
        MANIP *mnp;                                             /*3*/
        JNTS rcclpark;                                          /*4*/
        char *robotName;                                        /*5*/

        rcclSetOptions (RCCL_ERROR_EXIT);                       /*6*/
        robotName = getDefaultRobot();                          /*7*/
        if (!getRobotPosition (rcclpark.v, "rcclpark", robotName))
         { printf ("position 'rcclpark' not defined for robot\n");
           exit(-1);
         }
                                                                /*8*/
        t = allocTransXyz ("T", UNDEF, -300.0, 0.0, 75.0);
        p = allocTransRot ("P", UNDEF, P_X, P_Y, P_Z, xunit, 180.0);
        pos = makePosition ("pos", T6, EQ, p, t, NULL);         /*9*/

        mnp = rcclCreate (robotName, 0);                        /*10*/
        rcclStart();

        movej (mnp, &rcclpark);                                 /*11*/

        setMod (mnp, 'c');                                      /*12*/
        move (mnp, pos);                                        /*13*/
        stop (mnp, 1000.0);

        movej (mnp, &rcclpark);                                 /*14*/
        stop (mnp, 1000.0);

        waitForCompleted (mnp);                                 /*15*/
        rcclRelease (YES);                                      /*16*/
}
