This is an interesting application, Here's how I would approach it:
1) Realistically only 2 of the Analog Inputs are usable, as the other 2 are on the tool flange, and you probably wouldn't want to run a loom the whole way up the arm.
2) The joystick probably outputs a voltage that is 0 at center, and goes positive or negative as it is manipulated on an axis (I assume). You may have to wire a voltage divider so the output is 0V on one extreme of its range, and 10V at the other.
3) One analog input will be your X, the other the Y. Further, you will need two buttons to control +Z and -Z.
4) I would suggest that rather than mapping the joystick axes to joints, you should map them to cartesian velocities. Then you will be able to jog the arm over the whole workspace, albeit without changing the orientation.
4) In the linked video, the arm only moves on one linear axis at a time. If you're ok with this limitation then the program is relatively straightforward. Using pose_trans() and get_actual_tcp_pose(), you can generate a new pose relative to the current tool pose. You then use a continually evaluated If...Else to jog the arm there. The If will use the state of the analogue input as its argument. By setting a low acceleration and high velocity, the arm should smoothly ramp up to speed. Use stopl() after the IF to avoid a protective stop when the joystick is released. For the X axis this may look like:
## IF is continually evaluated ##
If (analog_in0 > 5.1) :
pose_current = get_actual_tcp_pose()
pose_target = pose_trans(pose_current,p[1,0,0,0,0,0])
movel(posetarget,0.2,1)
end
stopl(3)
If (analog_in0 < 4.9) :
pose_current = get_actual_tcp_pose()
pose_target = pose_trans(pose_current,p[-1,0,0,0,0,0])
movel(posetarget,0.2,1)
end
stopl(3)
You'll need this code 3 more times, for each axis positive and negative, just change the comparison in the If, and the pose given as an argument to the pose_trans().
5) If you want to combine linear movements simultaneously (a diagonal movement), you'll need to use servoj() I think. I'm not well versed in using that command so am little help, but I can say you will need to use get_inverse_kin() to go from cartesian coordinates to jointspace, which servoj() uses.
tthiy1
Hi, I am having the same problem,Fionn_Merz said:This is an interesting application, Here's how I would approach it:
1) Realistically only 2 of the Analog Inputs are usable, as the other 2 are on the tool flange, and you probably wouldn't want to run a loom the whole way up the arm.
2) The joystick probably outputs a voltage that is 0 at center, and goes positive or negative as it is manipulated on an axis (I assume). You may have to wire a voltage divider so the output is 0V on one extreme of its range, and 10V at the other.
3) One analog input will be your X, the other the Y. Further, you will need two buttons to control +Z and -Z.
4) I would suggest that rather than mapping the joystick axes to joints, you should map them to cartesian velocities. Then you will be able to jog the arm over the whole workspace, albeit without changing the orientation.
4) In the linked video, the arm only moves on one linear axis at a time. If you're ok with this limitation then the program is relatively straightforward. Using pose_trans() and get_actual_tcp_pose(), you can generate a new pose relative to the current tool pose. You then use a continually evaluated If...Else to jog the arm there. The If will use the state of the analogue input as its argument. By setting a low acceleration and high velocity, the arm should smoothly ramp up to speed. Use stopl() after the IF to avoid a protective stop when the joystick is released. For the X axis this may look like:
## IF is continually evaluated ##
If (analog_in0 > 5.1) :
pose_current = get_actual_tcp_pose()
pose_target = pose_trans(pose_current,p[1,0,0,0,0,0])
movel(posetarget,0.2,1)
end
stopl(3)
If (analog_in0 < 4.9) :
pose_current = get_actual_tcp_pose()
pose_target = pose_trans(pose_current,p[-1,0,0,0,0,0])
movel(posetarget,0.2,1)
end
stopl(3)
You'll need this code 3 more times, for each axis positive and negative, just change the comparison in the If, and the pose given as an argument to the pose_trans().
5) If you want to combine linear movements simultaneously (a diagonal movement), you'll need to use servoj() I think. I'm not well versed in using that command so am little help, but I can say you will need to use get_inverse_kin() to go from cartesian coordinates to jointspace, which servoj() uses.
In your function below, won't the robot create jitter movement as it is moving 1mm (i believe) in positive x every time?
Is there is a solution to fix this?
If (analog_in0 > 5.1) :
pose_current = get_actual_tcp_pose()
pose_target = pose_trans(pose_current,p[1,0,0,0,0,0])
movel(posetarget,0.2,1)
end
basically what i want is:
If (analog_in0 > 5.1) :
move the robot arm in +x without any jitter
else:
don't move the robot
Can someone please help me out?
Thanks a lot
Hi, I've been in IT for 30 years but very new to UR's and Robotiq, so hoping someone here can give some guidance.
A client needs to have a joystick control his UR3 and Robotiq 2 finger gripper urgently for a very high profile showcase.
This youtube video shows EXACTLY what's needed but I can't seem to get hold of the video creator.
https://youtu.be/TCSKiWe-4jo
It’s suddenly clicked for me, the guy on youtube basically said it’s simple, just connect the joystick wires to the analogue ports on the UR controller and rest is in polyscope.
Joysticks have been around for decades and are pretty simple devices from what I can see.
Now there’s only 4 analogue inputs on the UR controller, so that explains why in the video there’s no wrist movement, but I reckon the customer will accept that, so we use 3 for the Base, Arm and Elbow plus one more to open/close the gripper.
So assuming the above is true then what would the actual program in Polyscope look like?
Here’s some bad pseudo code:
If Analogue1 > 0 then rotate base (in proportion to signal)
If Analogue2 > 0 then rotate arm
If Analogue3 > 0 then rotate elbow
If Analogue4 > 0 then open gripper
Could someone help me a bit with the coding?
And would there be any way to control the wrists (that would be nice but probably not absolutely needed)
My apologies as I'd posted this in the wrong forum, it's more about programming than the gripper I think.Open to any and all suggestions/criticisms/anything