Page 1 of 1

Joint configuration using remote API

Posted: 07 Apr 2021, 16:52
by adreen
Hi,
I would like to ask, if there is any way how to set Minimal position and
Position range in joint properties while using remote API.

I made a model of my real robotic arm in Coppelia and I would like to be
able change these settings dynamically. You see, I have two cpp programs,
first for real hand and second for Coppelia, and when I change position
range for real hand I keeps these settings in .txt file from which I would
like to read values, use them for Coppelia and vice versa.

I hope it makes sence.

Best regards, Jan

Re: Joint configuration using remote API

Posted: 08 Apr 2021, 08:16
by coppelia
Hello Jan,

you have several ways how you can do this. First I'd use a customization script that handle that task.

You mention a text file that contains configuration data. So the customization script could read the configuration file in its initialization phase (sysCall_init), or better, in the sysCall_beforeSimulation callback.

You also mention the remote API. So from e.g. a legacy remote API client you can call simxCallScriptFunction upon a script function that would do something like:

Code: Select all

function setRangeData(inInts,inFloats,inStrings,inBuffer)
    sim.setJointInterval(inInts[1],false,{inFloats[1],inFloats[2]})
    return {},{},{},''
end
Make sure to call above function before simulation starts, otherwise you might not be able to change the range properties (or you will have to call sim.resetDynamicObject on that joint afterwards)

Cheers