0
Answered

drive CurrentPosition() in IK mode issue

VIZtech4 1 year ago in realvirtual.io Starter and Professional updated 1 year ago 8

Using professional version.

When driving a robot arm around in Axis mode using a joystick, dirve CurrentPosition reports the correct angles.

However when in IK mode, the returned values change sign at the 180 position.

How can I get proper angle values in IK mode ?

Answer

Answer

Hi, the solver will not get any values greater or lower than -180 or +180  because with this solutions all possible positions can be described. 

Under review

Hi, for the moment there is no solution for this. The values are calculated in a "BlackBox" inverse kinematic DLLs. Only solution that I see is, that you monitor and correct the values yourself.

I think a consequence of this is that the drive limits are not respected in IK mode.

In our application where we are driving a robot in IK mode using a joystick, it's difficult to tell if all the 6 drives do it, but those I have observed do not obey the limits like they do in Axis mode.

Drive Limits should be respected in IK mode. I need to check but also in IK mode each solution is checked and if a point in the path is not reachable there should  be a message. Will get back to you soon when I have checked the issue.

+1

Hello,

Sorry I have to return to this topic.

You are correct about the limits being respected.

My issue is, I have limits on axis6 of a 6axis robot set to -350 and +350.

Because the IK solver returns values in the range -180 to +180 the limits are never reached and so the axis just rotates for ever.

It means I have two problems, having the limits respected and getting a meaningful value for drive6.CurrentPosition.

All of this works perfectly in Axis mode it's in IK mode where the problem exists.

If there was an answer for getting a drive.CurrentPosition in the range of -360 to +360 then the limits would be respected but try as I might, I have not reached a solution..

Regards

Answer

Hi, the solver will not get any values greater or lower than -180 or +180  because with this solutions all possible positions can be described. 

Success !

Using my new variable from -360 to +360 I only checked the limits for axis4 and axis6 once the rotation had exceeded 180 and -180 in the other direction.

Then, by a simple calculation with your variable, "drivepos" I now have the limits working at -350 and +350.in IK mode.

Progress !

I now have a variable that takes drive6.CurrentPosition in IK mode and maps it to -360 to +360

I thought it was going to be easy to incorporate this into the limits check but it's not.

In your file, RobotIK.cs there is a method called, private void CalcPosition(. . . ) and that is where the limit checks are carried out using variable "drivepos".

Can you please give me some guidance as to how I can use my own float variable instead of using "drivepos" to check against the limits ? this would apply to axis4 and axis6 only as their limits = -350 to +350

Regards