How can I add a force sensor using the remote API?

Typically: "How do I... ", "How can I... " questions
Post Reply
fai
Posts: 10
Joined: 23 Sep 2015, 21:04

How can I add a force sensor using the remote API?

Post by fai »

Hi,

I would like to add a force sensor in order to link two models using the JAVA API. Is that possible? The only way that I found is to save a force sensor as a model. Then, I can load it. Is there another solution?

Cheers!

coppelia
Site Admin
Posts: 10379
Joined: 14 Dec 2012, 00:25

Re: How can I add a force sensor using the remote API?

Post by coppelia »

Hello,

the solution loading a model is not elegant. You could do following instead:

on the V-REP side, you could have a dummy with a non-threaded child script attached, that reads a specific signal (e.g. a string signal). If the string signal has a specific code, then the child script will create a torque/force sensor, and send back its handle. In that case, the child script could be seen as a server that executs higher-level tasks for the remote API client. Such an example is available in the programming/remoteApiBindings folder, for each language (check complexCommandTest, which will create a dummy instead of a force/torque sensor).

Cheers

Post Reply