## Joint configuration using remote API

Typically: "How do I... ", "How can I... " questions
Posts: 1
Joined: 06 Apr 2021, 20:51

### Joint configuration using remote API

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

coppelia
Posts: 8450
Joined: 14 Dec 2012, 00:25

### Re: Joint configuration using remote API

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