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.
Because of un-manageable amounts of spam despite our use of CAPTCHAs, email authorization, and other tools, we have discontinued this forum (see the 700k+ registered users with validated email addresses at right?). Please email us any questions or post bug reports and feature requests on GitHub at https://github.com/jevois -- The content below remains available for future reference.

JeVois Inventor Python ,change module' s parameters in GUI

0 votes

How can I change some parameters of my own Python module in the JeVois Inventor GUI.

For example HSV values for a given Opencv function ....

Thank You

asked Dec 20, 2018 in Programmer Questions by phk010 (140 points)

1 Answer

0 votes
This is not supported yet. The abstractions we use for parameters in C++ rely on templates and I believe we cannot easily transfer them to python. We have been looking into workarounds but the priority is not so high compared to other items so it might take a while,

In the meantime, your best bet is to add custom commands, and then set the parameters using those commands from the console in the inventor.

see for example http://jevois.org/doc/PythonTutorial3_8py_source.html

you implement parseSerial() to decode received commands that use command names that are not already used by the JeVois engine. Then also implement supportedCommands() to provide some help message.

for example, you could define a new command which you would want to type in the console of the inventor:

setMinHue value

in parseSerial() you get the whole line of text that was entered in the command-line by the user. So just break it into tokens, then if the first token is "setMinHue" convert the second token to a number an update the internal parameter of your module that handles the min hue with that number.

more info about parseSerial() is here: http://jevois.org/doc/ProgrammerPython.html
answered Jan 4, 2019 by JeVois (46,580 points)