Inverse Kinematics Issue

Inverse Kinematics Issue

Postby weibull760 » Sun Apr 02, 2017 5:52 pm

So I'm getting an error when trying to use the Inverse Kinematics vparameter. I'm using very similar code to what is posted here in the help. http://www1.adept.com/main/KE/DATA/ACE/AdeptSight_Ref/PropertiesRef/InverseKinematics.htm

Every time I try to set a location variable = to the output of the VLOCATION function using the inverse kinematics ID number (10060), I get a network timeout error (*Network timeout* (-562)

All of the vparameter callouts work fine.

Thanks for your help!

Here's my code:

Code: Select all
.PROGRAM f.inv.vision(loc)

; This program will move the robot so that a given point in the   
; robot frame of reference can be seen in a given point in the vision 
; Coordinate system (Calibrated)   

        GLOBAL LOC rob.vision.pt
        AUTO REAL loc.tmp[5], robot_x, robot_y, vision_x, vision_y, vision_rot
        AUTO REAL cam.idx, tmp.val
        AUTO LOC t.loc

; This defines the point in the robot coordinate system that should
; be visible in the camera

        cam.idx = 3

        DECOMPOSE loc.tmp[] = loc
        robot_x = loc.tmp[0]
        robot_y = loc.tmp[1]

; This is the point where the robot point should be seen in the
; camera coordinate system. These units are mm (Calibrated Image).
; When they are set to (0,0), it means the center of the image.
; Vision_rot only applies for a ToolMountedCamera

        vision_x = 0
        vision_y = 0
        vision_rot = 0

; Tell ACE Sight what are the chosen values
; for configuration and vision points.

        VPARAMETER(-1, cam.idx, 10401, 1) $sv.client_ip = vision_x
        VPARAMETER(-1, cam.idx, 10402, 1) $sv.client_ip = vision_y
        VPARAMETER(-1, cam.idx, 10403, 1) $sv.client_ip = vision_rot

; Tell ACE Sight what are the chosen values for robot point.

        VPARAMETER(-1, cam.idx, 10404, 1) $sv.client_ip = robot_x
        VPARAMETER(-1, cam.idx, 10405, 1) $sv.client_ip = robot_y

; Ask ACE Sight where to move the robot in order to make
; robot point seen in vision point

        SET rob.vision.pt = VLOCATION($sv.client_ip, -1, cam.idx, , 10060, 1)

        RETURN

.END
weibull760
 
Posts: 11
Joined: Mon Mar 02, 2015 10:56 am

Re: Inverse Kinematics Issue

Postby weibull760 » Tue Apr 04, 2017 7:23 pm

Looks like I was able to figure it out but I'm still not sure why this worked.

I had to store the VLOCATION into a local variable first and then I could store it into a global var.

Here's what I had to change in case anyone else runs into this problem:

Code: Select all
GLOBAL LOC rob.vision.pt
AUTO LOC t.loc

;Instead of using the code below which didn't work...

     SET rob.vision.pt = VLOCATION($sv.client_ip, -1, cam.idx, , 10060, rob.number)


;I had to change it to this.  Not sure why this was required but it works like a charm now.

     SET t.loc = VLOCATION($sv.client_ip, -1, cam.idx, , 10060, rob.number)

     SET rob.vision.pt = t.loc

weibull760
 
Posts: 11
Joined: Mon Mar 02, 2015 10:56 am


Return to AdeptSight

Who is online

Users browsing this forum: No registered users and 2 guests