Kinematics Issue with MoveJ

Hi,

I have one urp with only one MoveJ that contains 5 waypoints. The arm (ur3e ) does not have any issue with the movements.

However, if I send the exact positions via RTDE, I get kinematics error before the final position.

How should I debug this further?

Hi @kayanh, write the joint angles of the waypoint directly into general purpose registers within polyscope and see if those will run/if you get the same values you’re receiving over RTDE.

Hi @ajp, I am kind a beginner, apologies beforehand.

Do you mean setting movej script within polyscope?

Also, I am trying to figure out, rather than pose, how can I send joint angles as well.

Hi @kayanh,

I assumed from the fact you were working with movej that you were using joint angles, but it sounds like you are using tool poses instead? How are you getting these waypoint values out of Polyscope in the first place in order to send them back in via RTDE?

It might help to see your program, so we can see how you are reading the values out of RTDE and into a motion command.

You can get the joint angles of a waypoint into a variable using the method shown in the screenshot below:

Hi @ajp,

Here is my example program. It is the example program rtde_control_loop.urp that is located at RTDE.zip btw. The only difference is I am using MoveJ instead of MoveL.

How are you getting these waypoint values out of Polyscope in the first place in order to send them back in via RTDE?

I am not getting them from Polyscope. I determined those values via example program, now I am just sending them to Polyscope.

I expect the issue is with the example not being fully compatible with the UR3/UR3e. The reach of these arms is 0.5m but the second target point in the example is very close to the limit of this reach. If you have any Z offset on your TCP then this will become unreachable.

The kinematics error you are seeing means that the controller can’t find a set of joint angles to move the tool to the required target position, and that’s because the arm is not long enough to reach it.

If you reduce the second value (-0.51) in the setp2 list on line 61 of the example python script, it should work fine:

setp2 = [-0.12, -0.51, 0.21, 0, 3.11, 0.04]

1 Like

Hi @ajp,

Many thanks for this. I appreciate, if you can explain how did you figure out this.

If you reduce the second value (-0.51) in the setp2 list on line 61 of the example python script, it should work fine:

So, I can figure out myself later on.

If you are using MoveJ and you don’t mind too much, set on the MoveJ the “use joint angles” options. That way the robot will follow the waypoints using the joints value without taking into account the TCP. Also make sure that before reading the position you have set the TCP properly on the robot side.

To use a point with only joints values, you need to use a list instead of a pose variable.

# Before_start
min_q = 0
valid_q = [min_q, min_q, min_q, min_q, min_q, min_q]
max_q = 6.283 # 2*pi rad

# Robot_program
moveJ # use joint angles
  - valid_q

# Thread_1
setq = Tool_const
FROM_INT_TO_RAD = 0.001 # reading values from 0 to 6283
# loop
tmp_q = [0, 0, 0, 0, 0, 0]
    # loop from 0 to 5
      tmp_q[i] = FROM_INT_TO_RAD * read_input_register(i) 
      if tmp_q[i] >= min_q and tmp_q[i] <= max_q:
	     valid_q[i] = tmp_q[i]
      if tmp_q[i] > max_q:
	     valid_q[i] = max_q
      if tmp_q[i] < min_q:
	     valid_q[i] = min_q
1 Like