Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers. Note that due to large amounts of spam attempts, your first three posts will be manually moderated, so please be patient.
We have moved to a new forum at http://jevois.usc.edu, please check it out. The forum at jevois.org/qa will not allow new user registrations but is maintained alive for its useful past questions and answers.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

is there any way to trigger python module on jevois over usb?

0 votes
I am new to jevois and vision applications in general.

I was wondering if there is a way to trigger a python code on the jevois over CLI and read module result?

From the documentation it seems like the engine selects the module based on output resolution?

I would like to:

send a trigger over usb to the jevois camera to run a python script which would...

      capture an image, process and return co-ordinates of a target (circle) in image over usb/serial
      and then wait for next trigger or kill the script and be able to run/trigger it again...

can you please direct me to an appropriate tutorial or guide me towards the right path, thanks.
asked Oct 1, 2018 in Programmer Questions by brendon (120 points)

1 Answer

+1 vote
Yes, this can be done. Vision modules can operate in two ways: with USB output, and without. With USB output, indeed, the module is selected by output resolution. Without USB output, the module is selected in the CLI using the setmapping2 command. For your module, you would need to:

- develop a module that implements processNoUSB() as this is the function that is called when there is no USB output

- also implement parseSerial() and supportedCommands() in your module, this is how you will send the trigger to your module.

These will help you:

http://jevois.org/tutorials/ProgrammerTutorials.html -- go over the ones that use JeVois inventor, this is the easiest way to get started.

http://jevois.org/tutorials/ProgrammerPythonSaveImages.html -- was written before JeVois Inventor and many of the steps can be done more easily now with the Inventor, but gives you an example of processNoUSB() and launching the module using CLI commands setmapping2 and streamon.

http://jevois.org/doc/ModulePythonTutorial.html - look for parseSerial() for an example of how to use it

http://shaofanlai.com/post/63 - example module that uses parseSerial() and supportedCommands()
answered Oct 1, 2018 by JeVois (46,580 points)
There's another way to do this. If you create a custom python module, you can add commands, receive the command via USB and do different things in your custom python module based on the commands you receive. You can do this even if you're outputting video via USB.
...