Page 1 of 1

Add a way to read joint maximum force

Posted: 03 Jan 2020, 00:06
by Adrian
Hi,

If I'm informed correctly, there is currently a way to set the "Maximum Force" of a dynamic joint using function sim.setJointForce, but no way to read the value of said parameter. There is only a way to read the "Current Force" applied to a joint using sim.getJointForce.

It would be nice to have a getter for the Maximum Force as well. It looks like almost all other dynamic parameters for joints have a Object Parameter ID already, except for the Maximum Force.

I guess it might be worth considering to add a new parameter ID (e.g. sim.jointfloatparam_maximum_force) or a new getter function (e.g. sim.getJointMaximumForce()).

For my specific project, this would make it easier to monitor the status of multiple joint controllers and check whether the maximum force was reached or not.

Best,
Adrian

Re: Add a way to read joint maximum force

Posted: 03 Jan 2020, 10:29
by coppelia
Hi Adrian,

I agree. In next release you'll have following two API functions:

sim.setJointMaxForce
sim.getJointMaxForce

while sim.setJointForce will be deprecated (but still functional), to avoid confusion or any relation with sim.getJointForce.

In the mean time, as a workaround, you could implement a script function that buffers the joints max. forces, when setting them, and another function that retrieves values from that, when getting them.

Cheers

Re: Add a way to read joint maximum force

Posted: 14 Jan 2020, 13:55
by coppelia
CoppeliaSim V4.0.0.rev4 is out, and includes mentioned changes.

Cheers

Re: Add a way to read joint maximum force

Posted: 16 Jan 2020, 01:41
by Adrian
Very nice! Thank you!