Export the vision filter code to python script

Typically: "How do I... ", "How can I... " questions
Post Reply
Piorot
Posts: 4
Joined: 17 Nov 2020, 14:48

Export the vision filter code to python script

Post by Piorot »

Hi, i have a question to the vision sensor filters or now vision callback functions.
I want to use V-REP / CoppeliaSim for a Pick-and-Place project.
In this project i want to simulate an object recognition with a 3D vision sensor (point cloud) and after that transfer this to a real robot / RGBD camera.
Until now i can make the simulation by using simVision / simIM but where is the code of this methods?
The real project will be in python and ROS so if i'm right i can't use things like "simVision.edgeDetectionOnWorkImg()" in a python script becaus this a V-REP intern function?

Any ideas how i can solve this?

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

Re: Export the vision filter code to python script

Post by coppelia »

Hello,

you have several ways of doing this. For instance:
  • wrap some c++ code inside of a plugin, which will export a new script function, e.g. simMyPlugin.process(). And you can then submit the original image of the vision sensor to your plugin.
  • from an external application, you can stream raw images from the vision sensor, and process them in your application (and possibly send them back to CoppeliaSim for display). You can use ROS, ROS2, the legacy remote APi or the B0-based remote APi for that.
When your processing code is located in an external application (i.e. not a script or a plugin), then you might also want to run CoppeliaSim in synchronous mode, so that your external application triggers each individual simulation step, in order not to miss a frame. This of course depends on your application requirements.

Cheers

Post Reply