Moving a point along tool axis

  • Hello every one!


    I have an arm that is using a camera to find a part. Theses parts are arranged in a 16x2 array. I started out with a point called XPick which is at the X0Y0Z0 of base[16]. I then offset it to the next part in the array and take a picture, Get the cameras offsets add them to XPick and move the gripper there. Half way down the long side of the array I need to A180 the camera to avoid crushing my end-of-arm tooling. The problem is the camera is now the opposite orientation of my base, so the X and Y offsets are wrong. Is there a way to move a point like Xpick in relation to the cameras frame?


    I assumed I needed the geometric op but my experiments with it were fruitless.


    I was going to post pictures and code but I'm not sure what would be helpful. Let me know if any one has Ideas or needs more info!

  • The camera is mounted to the robot end effector, yes?


    It sounds like you are using a Tool-mounted camera to perform Base shifts. That's... odd. Doable, but odd.


    How did you do your original robot<>camera calibration? And how are you changing XPick's rotation?


    Generally, to use a Tool-mounted camera, you create a TCP that is aligned with the camera, and apply the camera corrections in that TCP.


    So, you would move to the photo-taking position using Base shifts, as normal. Then, when taking the camera shot and getting the correction data, apply that in Tool. So, something like:

    There's programatically better ways to do this, and much more robust. But that's the general idea.

  • The camera is mounted to the robot end effector, yes?

    Yes, it is a tool mounted camera.


    It sounds like you are using a Tool-mounted camera to perform Base shifts. That's... odd. Doable, but odd.

    I never rotate or shift the base. I have a point (Xpick) that starts at the base and is constantly moving.

    How did you do your original robot<>camera calibration? And how are you changing XPick's rotation?

    For the original calibration we used a cad model of the end effector to get the numerical data.

    Generally, to use a Tool-mounted camera, you create a TCP that is aligned with the camera, and apply the camera corrections in that TCP.

    Lets say the camera sees the part is off {X 10, Y -55} you are saying I should adjust the gripper TCP instead of XPick?

  • LIN $POS_ACT_MES : {CameraX, CameraY, 0, CameraRZ, 0, 0} ; apply camera shifts in Tool frame

    This bit of code was what I needed to know. Thank you skyefire:thumbs_up:. Since the TCP is at XPick when it takes the picture

    Code
    XPick = $POS_ACT_MES:{camX, camY, 0, camA, 0 ,0}
    $TOOL = gripper
    LIN XPick

    Moves XPick to the center of the part with my gripper. This works good for my application.

    just out of curiosity Is there a way to accomplish this without my TCP being at XPick?:thinking_face:

  • just out of curiosity Is there a way to accomplish this without my TCP being at XPick?:thinking_face:


    Of course- that would require general solution whose specific case you just solved.


    General solution would be something like:

    1. Create geometric transformation chain to calculate where Xpick is in Tool/Camera coordinate system. Call this XPickInCamBase.

    2. Apply offset in Tool/Camera coordinate system to XPickInCamBase.

    3. Apply reversed transformation chain from step 1 to coordinates you got in step 2. Get XPickWOffset.

    4. In case the camera is not completely parallel to your workbase, transfer only X and Y (and depending on your setup maybe A) values from XPickWOffset to XPick.

    5. Profit!


    Edit: However temped you are, do not try to implement all these steps with one line of code. It becomes frustrating to debug.

Advertising from our partners