Most effective way to get collision information from remote API

Typically: "How do I... ", "How can I... " questions
Post Reply
Matthieu
Posts: 6
Joined: 24 Dec 2013, 14:31

Most effective way to get collision information from remote API

Post by Matthieu » 04 Apr 2018, 14:04

Hello,

We want to use V-Rep to check if a given trajectory will conduct to a collision before it is actually played on the physical robot.

We control the physical robot as well as the virtual robot using python (in v-rep 3.2.0 with the remote API). We need now to add the collision information. I guess the best way could be to have a dummy object with a child script that sends whether or not a collision happened? if yes, Do you have Lua script exemple to do this?

How could we also get current minimal distance between any collidable objects ? It would allow to block motion that are close to a collision.

hope you can help us :)

Thanks,
Matthieu

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

Re: Most effective way to get collision information from remote API

Post by coppelia » 07 Apr 2018, 09:13

Hello Matthieu,

you have several ways of doing this. But since you probably want to have a short reaction time when a specific condition occurs, best would be to use simxCallScriptFunction in streaming mode.

In your scene, prepare a script function that can then be called by your remote API client. in that function, do whatever you need to verify. e.g. check for collisions, check for min, distances, etc. Then return a status (or several values needed by your remote API client).

A slightly simpler approach would be to check collisions, etc. inside of the sensing section of a child script. Then set a signal that the remote API client can stream.

Cheers

Post Reply