Making c++ program into plugin




I’m trying to add a plugin for visual odometry. I’ve already written a c++ program that does that, but I’d like to be able to launch the program by enabling a plugin on the ROV cockpit. Right now, I can use the video from the ROV by giving the program the address (“”).

I’ve looked at [Tutorial] Creating an OpenROV Plugin and I’ve managed to add the template plugin to testview. I don’t know anything about Javascript or NodeJs so I just want the plugin to launch the program without re-writing it. So I’ve tried creating a child process, as google told me I should, and I thought I should do that in the “enable” function (in the visual_odometry.js file). But I cannot add “require(child_process)”. Apparently, I can’t require things in the browser (Once again, I don’t know anything about JavaScript).

So, my question is: Does anyone know what I should do ? If I have an executable on my computer, is it possible to launch it from the cockpit ? How ?

Thank you !


Sorry for the late response.

Sounds like an cool project. In summary, you can launch a standard program from cockpit if you want using node’s exec and spawn apis. Here is where we call another program from node:

But I would need more information to figure out what you want to do to be much more help.