Movej runs into joint limit

Hi,

For technical reasons I have limited joint range on axis 6 to ±270deg.
The robot is send to destination pose locations sent via a script from a host system. Now I have the problem that the robot controller chooses a solution for axis 6 which is outside (in my case it is apparently sent to -290deg) instead of +60 deg when axis 6 is positioned at -180deg.
IMHO the trajectory generator should find a solution that lies within a valid joint range.
I’d appreciate if someone could shed some light into this.

Well, you need to take care of that yourself. You can hint the inverse kinematic solver where it should look for solution with qnear parameter.

get_inverse_kin(x, qnear, maxPositionError=1e-10,
maxOrientationError=1e-10)

Inverse kinematics
Inverse kinematic transformation (tool space -> joint space). If qnear is
defined, the solution closest to qnear is returned. Otherwise, the
solution closest to the current joint positions is returned.

Parameters
x: tool pose
qnear: list of joint positions (Optional)
maxPositionError: the maximum allowed position
error (Optional)
maxOrientationError: the maximum allowed orientation
error (Optional)

Look at this topic:

regards,
Alexander

Hi

thanks for the tip. The thing with qnear ist that if a given value in qnear is anywhere close to a joint limit it may happen that get_inverse_kin() returns a position which is outside the valid joint range… is it just me who believes this behaviour is not … well… ideal …? Other robot systems have a similar function but with different behaviour, e.g. the inverse kinematic solver returns a fault if no valid solution could be found or would lie outside a joint limit.
So no matter what, after a call to get_inverse_kin I have to cross check the obtained position with the actual joint limits (unfortunately, those need to be hard coded since reading out joint limits via script is not possible, right?) and correct them by a ±360deg addition in case the solution is outside joint range.