LBR IIWA Hand Guiding application with frames recording addChildFrame?

  • Hello everyone!



    We have a LBR IIWA 800 7kg with touch pneumatic flange. I am trying to create an app in which the user can, using hand guiding, record certain positions.



    I want to save the frames inside the Application Data that you can usually touchup on the smart pad and are accesible in the app through lbr_iiwa_7_R800_1.getFrame("/test");


    Digging up i found this:


    addChildFrame

    public ObjectFrame addChildFrame(String name,

    ObjectFrame parent)Adds a new frame with the given name and transformation = MatrixTransformation = IDENTITY to the given parent frame. Sets the owner of the new frame to the root owner.


    but it doesn't seem to work as i expected. no new frame is created when i give the new name, and when i provide the name and the parent name with : lbr_iiwa_7_R800_1.addChildFrame(P1,lbr_iiwa_7_R800_1.getFrame("/test_path")); i get a parent is null error.


    Does anyone know how to create new frames?

  • I believe 'addChildFrame()' is not meant to be used by users.


    The reason you have ObjectFrame and Frame separately is because while you have transformation data in both of them, only ObjectFrame can have teaching data(basically referring inverseKinematics and moreover, it doesn't match 1to1 because the robot has 7 DegreeOfFreedom) since you actually "teach" them with actual robot. And you might have noticed that you get your taught frames as ObjectFrame when you use getFrame() method. In application, you can make Frame variables to be used with their transformations as you "program" them. Which means, normally (yes normally), you can't make genuine ObjectFrame in any application because you can't teach positions of them.


    There is a sideway for you to do this. All ObjectFrames you made in "Application Data" tab are stored as an xml format in a file "RoboticsAPI.data.xml" which can be found on your src folder. And it means yes, you can directly write ObjectFrames by manipulating this file which is slightly dangerous since you are modifying a source file that Robot RuntimeOS is simultaneously access to. If you mess with something, you will loss every frames you taught and tool data as well. So try back up your file beforehand.

    And this code might be your help on that.

    Be aware that these code will not directly work if you just copy&paste. read comments, and just use it as a sample.


    Edited once, last by Seulki ().

Advertising from our partners