Home Programming


Left ArrowBack to discussions page
StoopidEngineerStoopidEngineer Posts: 15 Apprentice
Hey All - Hopefully a quick/easy question: I'm attempting to use Installation Variables as Global Positions so they can be used across multiple programs on the robot, and re-taught without having to teach them in every single program. So I'm going to the point with the robot and running a script to write the current pose into the variable, then calling that variable as a 'Variable Position' in the waypoint. 

I wrote a simple program (as obnoxious as that is) to ‘teach’ the points: variable = get_actual_tcp_pose() 

The problem is, I get the ‘Script function movej cannot find an inverse kinematic solution’ error. When I go into the Script file for the program, I see that all of the ‘normal’ waypoint movej commands look like this: 

movej(get_inverse_kin(p[-.865714192411, .346413018092, .404586829815, -1.216919131853, -1.127686692460, 1.175113434647], qnear=[-3.391362253819601, -1.8620155493365687, -1.6408041159259241, 3.538212776184082, -1.7426098028766077, 3.1503243446350098]), a=1.3962634015954636, v=1.0471975511965976) 

but the Script for the movej trying to use a variable position as the waypoint is simply: 

movej(variable, a=1.3962634015954636, v=1.0471975511965976) 

And kicks out an error every time.

Has anyone else ever tried to use Installation Variables to store waypoints? Am I doing something stupidly wrong here? I'm desperately trying to avoid having to write the entire thing from scratch in Script as well, because that would make me the only person in a large company who knows anything about the program, which is not a good long term solution. 

This is on a CB3 UR-10 with v3.9 of the software. 

Thanks all!

Best Answer


  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,264 Handy
    Are you writing the movej as script?  If so, you need to convert the pose that you are storing into joint positions. That’s what the get_inverse_kin in the top script example is doing. Feed that a pose and you get joint positions out. Movej requires joint positions, not a pose. Otherwise, I’ve never had an issue using a pose stored as an installation variable when using polyscope to define a waypoint using the variable type. 
  • StoopidEngineerStoopidEngineer Posts: 15 Apprentice
    @matthewd92 No, it's the default movej command in the PolyScope UI: 

    So I'm recording the variable with: variable = get_actual_tcp_pose() 

    and then immediately trying to call that variable as shown in the screenshot above, and getting the ‘Script function movej cannot find an inverse kinematic solution’ error. I initialize the installation variable to p[0,0,0,0,0,0] and then write over it with the little script above in it's own teach program. 

    I tried the 'get_actual_joint_positions' function thinking I couldn't feed movej a pose directly, but that errored out when I tried to teach it. I've been looking for other things to try, but I'm just not seeing anything, and I don't understand the error I'm getting, or why the script seems to be weird when it should all be driven off of the PolyScope program. 

  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,264 Handy
    Can you share a screen shot of your actual program?
  • StoopidEngineerStoopidEngineer Posts: 15 Apprentice
    @matthewd92 I think I missed the variable in the Installation Variable screenshot, but they're all the same, and acting the same. 

  • LoïcLoïc Posts: 34 Handy
    Are you sure that your StageForceTest variable is recorded before you send the MoveJ command?
  • StoopidEngineerStoopidEngineer Posts: 15 Apprentice
    @Loïc Yes - it's recorded in a separate program that does nothing else, and is then saved into the installation. I verified it has a value, and have tried different points that I know the robot can reach. I've even tried it with the program calling the position the robot is currently in, and it still results in the same error. 
  • StoopidEngineerStoopidEngineer Posts: 15 Apprentice
    What I have figured out, for what it's worth, is that if I use the 'Assign' command in the 'Teach' program, rather than a Script command that assigns the 'get_current_tcp_pose()' to the variable, everything seems to work fine. Both ways write the same value into the Installation Variable, and in the same format (p[X,Y,Z,A,B,C]) so I have no clue why one works and the other doesn't. I looked at the Script code for each, and don't see why anything would be different, but at this point I've just got to take it and move forward. 
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,264 Handy
    That’s an interesting discovery, I’ll try to test that out. I’ve been doing some testing on both e-series and CB3 but haven’t encountered this issue. I’ll try changing my assignment to script
  • StoopidEngineerStoopidEngineer Posts: 15 Apprentice
    Well, I guess you can add my name to the list of getting burned by the equality sign/equals sign list....sheesh. I'm glad you said something though - I don't know that I've ever really thought or understood the difference. 

    Thanks for the help and the heads-up Matthew! 
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,264 Handy
    No worries, I know about it and yet.....
Sign In or Register to comment.
Left ArrowBack to discussions page