1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. Fanuc Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Yaw and Pitch angles from Point in UF in WF

  • AlexMac
  • March 27, 2024 at 6:44 PM
  • Thread is Resolved
  • AlexMac
    Reactions Received
    1
    Trophies
    1
    Posts
    49
    • March 27, 2024 at 6:44 PM
    • #1

    Hello esteemed colleagues!

    I have a CRX5 with iRVision 2D and I am playing around with the math to translate the coordinates of a Point in a UF (found using iRvision) to WF, which I will later create a frame with. As a proof-of-concept, I made a Python program that does (I don't have Karel):

    1 - Create the Rotation matrix with given UF Coordinates (by matrix multiplying the rotation matrices of R(X)@R(Y)@R(Z) );

    2 - Create the Homogeneous Transformation Matrix by concatenating the Rotation Matrix calculated above, the XYZ coordinates of the UF and [0,0,0,1];

    3 - Matrix multiply the Homogeneous Transformation Matrix with the Point XYZ coordinates to get the WF coordinates of that Point;

    This part is working great, and is giving me the right results. However it only gives me the XYZ coordinates, so how can I get the angles? I noticed that R is pretty straightforward, just the Point(R) + UF(R) and you get the R angle in WF, but how about W and P?

    Thanks in advance for the help!

    Edited 4 times, last by AlexMac (March 27, 2024 at 6:56 PM).

  • Nation
    Typical Robot Error
    Reactions Received
    522
    Trophies
    9
    Posts
    1,900
    • March 27, 2024 at 7:21 PM
    • Best Answer
    • #2

    It should be as simple as matrix multiplying your user frame coordinates by your point coordinates to get your point in world, angles and all.

    Point in World = User Frame * Point in that Frame

    I wrote a utility to do matrix multiplication in TP.

    Check out the Fanuc position converter I wrote here! Now open source!

    Check out my example Fanuc Ethernet/IP Explicit Messaging program here!

  • AlexMac
    Reactions Received
    1
    Trophies
    1
    Posts
    49
    • March 28, 2024 at 1:46 AM
    • #3

    Nation, this is amazing! Not only you saved me a lot of time, because the next step would be "translating" my Python code into a Robot TP program, but it got the W and P just right. Amazing! Thank you very much!

    I might be pushing it, but do you mind explaining how you calculate the W and P in WF? In cartesian representation I mean...

  • Nation
    Typical Robot Error
    Reactions Received
    522
    Trophies
    9
    Posts
    1,900
    • March 28, 2024 at 2:57 PM
    • #4
    Quote from AlexMac

    I might be pushing it, but do you mind explaining how you calculate the W and P in WF? In cartesian representation I mean...

    No calculation is done discretely for W and P. It all comes out in the wash thanks to the way matrix multiplication works. The couple of utility programs I wrote take care of that by converting the passed in PRs to Matrix form before doing the math, and convert it back before the end. That conversion is handled by the controller.

    If what you are asking is how to do it in python, I've written some C# code to do that. It should be easy enough to convert.

    Check out the Fanuc position converter I wrote here! Now open source!

    Check out my example Fanuc Ethernet/IP Explicit Messaging program here!

  • AlexMac
    Reactions Received
    1
    Trophies
    1
    Posts
    49
    • March 29, 2024 at 2:35 AM
    • #5

    Nation, thanks for your insight! So, after some research I found that I need to multiply my Rotation Matrix generated with the UF WPR with the Rotation Matrix of the Point "P" in the UF (which will be only in RZ).

    Then you will have another rotation Matrix in your hands and now you can extract the WPR angles of point "P" in World Frame.

    The formula would be:

    W = atan2(r32/cos(P), r33/cos(P))

    P = atan2(-r31, sqrt(r32^2 + r33^2))

    R = atan2(r21/cos(P), r11/cos(P))

    r11, r21,r32 and r33 being the positions on the new rotation matrix.

    You even used these formulas in your program!

    So, all good now! Thanks so much for helping!

  • AlexMac
    Reactions Received
    1
    Trophies
    1
    Posts
    49
    • April 10, 2024 at 2:56 AM
    • #6

    Additionally, I was reading the iRVision B-83914EN-1/06 manual and I found a Karel program called MATRIX that does essentially what Nation's program does, which is the linear transformation between two PR's. The advantage of using this program is two:

    1 - It is built-in, so it comes with your 2D vision package, so every FANUC Robot with 2D iRVision installed should have it already;

    2 - It does not require a UF to perform the operations.

    The results are exactly the same.

    This program takes 3 arguments with a 4th optional argument if you wish to output error status:

    • Is the PR index containing the UF coordinates [input];
    • Is the PR index containing the Feature’s coordinates[input];
    • Is the PR index for outputting the transformed coordinates (the feature position and orientation in reference to the World Frame)[output];
    • Is the error code(optional)[output].

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Tags

  • Fanuc
  • transformation
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download