Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixel position to UR coordinates #1

Open
obenyaala opened this issue Jun 18, 2020 · 1 comment
Open

Pixel position to UR coordinates #1

obenyaala opened this issue Jun 18, 2020 · 1 comment

Comments

@obenyaala
Copy link

Hi,
I couldn't find another way of contacting you except for writing an issue :/

I am working on something similar that inculdes coverting a pixel position to UR coordinates. I would be grateful if you could share with me the basics of how you did it.

Thanks
Best Regards

@ErwinLutke
Copy link
Owner

ErwinLutke commented Jul 10, 2020

The way i did it is as followed:
Do note that the camera is mounted on the flange in this case.

  • I set the camera to a resolution of 1280*720.
  • With a measuring tape I physically checked how many centimeters where visible on the camera image.
  • I adjusted the height of the flange to get a measured width of 28,5cm on the camera.
  • With the centimeter to pixel ratio known I could now calculate the physical offset (28,5 / 1280 = CtP)
  • I used the center of the camera as my offset guide.
  • I used the CtP to calculate an objects distance from the center of the camera.
  • From the camera's center I physically measured the X, Y distance to the TCP. (47 and 50mm in my case)
  • Using the current TCP position (I used MODBUS to get it) and adjusting it in accordance with the offset so the TCP is now aligned with the object
    tcp_position[0] = tcp_position[0] + 47
    tcp_position[1] = tcp_position[1] + 50

Finally adjusting the height to enable the TCP to grab the object (my tool was a magnet)

If you have any questions, drop them here!

Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants