RobotStudio event

Log position of robot

Options
Hello!

I have a question about how to log the position of an IRB 1400 robot. We are two students who are using this robot to simulate a helicopter and collecting data to estimate the pose using camera and IMU in our master theisis project. To evaluate how good our estimates are we have to know our "true" position which is the robot. How can we do this? Can you do it without RobotStudio or do you have to use it? Maybe you can just log down the position to a file on a USB? Can you get information of at wich time the data was collected?

/Mvh Fredrik

Comments

  • frpa
    Options

    Hello,
    Yes, this could of course be done.

    You could write from  a background task that periodically logs the position of the robot, and writes the positions to a file. Check the CRobT function. You don't have to use RobotStudio.

    You can get accurate time measurement by using the clock functions in RAPID, e.g. ClkRead.

    Good luck!

     

    BR frpa
  • Petri
    Options
    Hi
     

    I use this code to get robot position but my robot can stop measurement place so I dont  use backround task:

     

     VAR iodev iodev1;

     

     PROC CurrentPosition()
     Open usbdisk1File:="Measurements.DOC", iodev1Append;
     Write iodev1, "";
     Write iodev1, "Current position"Pos:=CPos()NoNewLine;
     Write iodev1, "     "NoNewLine;
     Write iodev1, CTime()NoNewLine;
     Write iodev1, "  "NoNewLine;
     Write iodev1, CDate();


     ENDPROC
     
    BR
    Petri
  • Hello

    Thank you very much for your help. We have succeeded to write down position to a file in a USB stick. We solved it by using the functions that frpa recomended and use multitasking to log data while the robot operates. The next problem is get the orientation of the robot and not only the position. "CRobT" saves the pos as a robtarget datatype which consists of two parts, both pos (x,y,z) and orient (q1 q2 q3 q4) but function "Write" can not write this datatype. We used "CRob" instead because it is of datatype pos which "Write" can handle. Maybe you can force robtarget to become another datatype or divide it into pos and orient?

    /Fredrik

  • frpa
    Options

    Hello,

    Please see this example code on how to get the individual values (this actually prints on the TPU, but of course you can write to a file).

     

     CONST robtarget p10:=[[1270.00,0.00,1570.00],[0.707107,0,0.707107,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
     PROC Routine1()
      TPWrite NumToStr(p10.trans.x,3);
      TPWrite NumToStr(p10.trans.y,3);
      TPWrite NumToStr(p10.trans.z,3);
      TPWrite NumToStr(p10.rot.q1,3);
      TPWrite NumToStr(p10.rot.q2,3);
      TPWrite NumToStr(p10.rot.q3,3);
      TPWrite NumToStr(p10.rot.q4,3);
     ENDPROC

     

    BR frpa
    frpa2010-01-29 16:29:20