08-04-2023, 03:33 PM
I am using the C# API to import tool coordinate systems that were created in SolidWorks and attach them to a robot. I am importing the 4x4 matrix data that solid works uses and converting it to the 4x4 matrix format that RoboDK uses, which is working fine. The thing I can't figure out how to do is rotate these imported tool coordinate systems around the robot flange coordinate system, since they are importing in a different orientation from what I need. If I just rotate the matrix by multiplying it by another matrix that represents the rotation I need, it rotates about the tools origin and not the robot flange origin, which is to be expected. What I need to do is rotate around the flange origin as seen in the attached image. I really can't figure out how to do this from the RoboDK user interface as well, changing parameters always operates around the tools origin. With reference frames you can specify another reference frame so that relative rotations can be done, but this does not seem to be the case with tool objects. Ideally I just need the way to do this programatically using matrix math on the tool matrix prior to adding it to the robot, since this has to be an automated process involving several tools on a rotary tool head.