Your comments

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

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

Thank you for your reply.

I decided to use the methods shown here;

https://forum.unity.com/threads/best-script-to-get-acceleration-from-a-gameobject.1170295/

then use the mass of the object picked up to calculate force.

At the end of day the goal was to get an indication rather than total accuracy.

Thank you for your reply.

Relative to a 6DOF robot arm, we know this information;

1. The velocity, axis, direction and angle of the Drive at each joint

2. The kinematic parameters describing the dimensions of the robot

It should therefore be possible to calculate the velocity of the TCP in each world axis on a frame by frame basis.

Then, using the Unity FixedUpdate() method it would be possible to calculate acceleration over each fixed time frame.

If the robot then picked up a MU where it's mass is known, using,  force = mass * acceleration, the forces in XYZ could be calculated each frame.

If you could do the maths for that it would be excellent.

I realise this measures only forces due to load but in a simulation this would most likely be adequate, it certainly would for our application.

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.

Thank you, I have sent a private message.

Thomas, thank you.

I would suggest the error can get to a lot more than 5mm on a bigger robot.

When we are using the robot in Axis mode there is a requirement to switch into World mode so I was then moving the target object to the real TCP and there should have been no jump, that is the requirement and expectation.


I look forward to the beta next Monday


Best regards

Doug.

There also seems to be a position error in IK mode which increases as an axis moves away from the zero position.

I have this working very smoothly now.

1. move a TargetGameobject around using a joystick

2. make an IKTarget from that gameobject

3. use method "JumpToTarget()" using the IKTarget in step 2.

Note: I had to make JumpToTarget() public rather than private.