RobotStudio event

Create new wobjdata

Options
I need to create a new wobjdata with an offset and a rotiation. Is there any convenient way to do this in Rapid?

Basically I have a wobjdata (wobjC ) coming from a calibration session, that I need to create a new wobjdata from ( to make the program simpler to understand) I need to move the wobjC a bit in the X and Y direction and rotate it 180 degrees around Z.

Is there any convenient way to do this?


Comments

  • Lin
    Options
    copy the wobjdata you have.

    Use the copied wobjdata

     

    modify the components of the copied wobjdata.

     

    and execute your commands or instructions as per the edited "copied wobjdata".
    Lingaa
  • Laro88
    Options
    This works fine in RobotStudio, however I needed to do so in generated RAPID code:

    Please note that this just copies a a wobjdata and modifies the oframe stuff. Ideally I would like to compute a "fresh" wobjdata as the sum of the old wobjdata and the oframe stuff. However this requires a proper 3D Vector Api ( I will use Microsofts Media3D namespace to do this at some point in time )


    However, In C# the construction of a new wobjdata looks like this.

    //Create tobjdata variable for the rap polishing program
    RapidData rd_woCalibLathe =   controller.Rapid.GetRapidData("T_ROB1","MSystemVars","woCalibLathe");
               
    WobjData woCalibLathe = (WobjData)rd_woCalibLathe.Value;
               
    //System.Windows.Media.Media3D.Vector3D v3d = new System.Windows.Media.Media3D.Vector3D(woCalibLathe.Uframe.Trans.X
               
    WobjRapProgram = woCalibLathe;
    WobjRapProgram.Oframe.Trans.Z = (float)DistToLathe;
               
    Orient o = new Orient();
    o.Q1=0.5;
    o.Q2=0.5;
    o.Q3=0.5;
    o.Q4=-0.5;
    WobjRapProgram.Oframe.Rot = o;
               
    this.WriteToModule("PERS wobjdata wobjRapProgram:="+WobjRapProgram.ToString()+";");


  • Henrik Berlin
    Options
    Hi,
     

    Perhaps the posting in


    may provide some inspiration.
    Henrik Berlin
    ABB