JeVois  1.21
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
Loading...
Searching...
No Matches
jevois::Engine Class Reference

#include <jevois/Core/Engine.H>

JeVois processing engine - gets images from camera sensor, processes them, and sends results over USB.

The Engine is orchestrating the execution of vision processing software. It is a Manager, i.e., it is the root of a hierarchy of Component objects and it handles access to their Parameter settings and their construction, init(), unInit(), and destruction. The component hierarchy consists of Engine at the root, then one Module which is selected by the user at runtime, e.g., by selecting a given video format on video camera software running on a host computer connected to the JeVois hardware. The Module may then contain an arbitrarily complex hierarchy of Component objects with Parameter settings in them. Module derives from Component and thus may also have its own Parameter settings.

Engine contains the following basic elements:

  • A VideoInput, instantiated as either a Camera for live video streaming or a MovieInput for processing of pre-recorded video files or sequences of images (useful during algorithm development, to test and optimize on reproducible inputs);
  • A VideoOutput, instantiated either as a USB Gadget driver when running on the JeVois hardware platform, or as a VideoDisplay when running on a computer that has a graphics display, or as a MovieOutput to save output video frames to disk, or as a VideoOutputNone if desired for benchmarking of vision algorithms while discounting any work related to transmitting output frames.
  • A DynamicLoader which handles loading the chosen vision processing Module at runtime depending on user selections;
  • Any number of UserInterface objects, instantiated as either a hardware Serial port (for the 4-pin JST 1.0mm connector on the platform hardware), a serial-over-USB Serial port (visible on the host computer to which the JeVois hardware is connected by USB), or an StdioInterface (used to accept commands and print results directly in the terminal where the JeVois Engine was started, particularly useful when running on a generic computer as opposed to the platform hardware). When running on platform hardware, usually two UserInterface objects are created (one hardware Serial, one serial-over-USB Serial), while, when running on a generic computer, usually only one UserInterface is created (of type StdioInterface to accept commands directly in the terminal in which the jevois-daemon was started);
  • The list of VideoMapping definitions imported from your videomappings.cfg file. These definitions specify which video output modes are available over USB and their corresponding Camera settings and which Module to use, as well as which modes are available that do not have any sreaming video output over USB (e.g., when connecting the hardware platform to an Arduino only).

The main loop of Engine runs until the user decides to quit, and basically goes through the following steps:

  • Create an InputFrame object which is an exception-safe wrapper around the next available Camera frame. The frame may not have been captured yet. The InputFrame can be understood as a mechanism to gain access to that frame in the future, when it has become available (i.e., has been captured by the camera). This is very similar to the std::future framework of C++11.
  • When the current VideoMapping specifies that we will be streaming video frames out over USB, also create an OutputFrame object which is an exception-safe wrapper around the next available Gadget frame. This is also just a mechanism for gaining access to the next blank video buffer that is available from the USB driver and that we should fill with interesting pixel data before sending it over USB to a host computer.
  • Call the currently-loaded Module's process() function, either as process(InputFrame, OutputFrame) when the current VideoMapping specifies that some video output is to be sent over USB, or as process(InputFrame) when the current VideoMapping specifies no video output. Any exception thrown by the Module's process() function will be caught, reported, and ignored. The process() function would typically request the next available camera image through the InputFrame wrapper (this request may block until the frame has been captured by the camera sensor hardware), process that image, request the next available output image through the OutputFrame wrapper (when VideoMapping specifies that there is USB video output), and paint some results into that output image, which will then be sent to the host coputer over USB, for display by some webcam program or for further processing by some custom vision software running on that computer. In addition, the currently loaded Module may issue messages over the UserInterface ports (e.g., indicating the location at which an object was found, to let an Arduino know about it).
  • Read any new commands issued by users over the UserInterface ports and execute the appropriate commands.
  • Handle user requests to change VideoMapping, when they select a different video mode in their webcam software running on the host computer connected to the JeVois hardware. Such requests may trigger unloading of the current Module and loading a new one, and changing camera pixel format, image size, etc. These changes are guaranteed to occur when the Module's process() function is not running, i.e., Module programmers do not have to worry about possible changes in image dimensions or pixel formats during execution of their process() function.
  • Pass any user requests received over USB or UserInterface to adjust camera parameters to the actual Camera hardware driver (e.g., when users change contrast in their webcam program, that request is sent to the Engine over USB, and the Engine then forwards it to the Camera hardware driver).

Definition at line 402 of file Engine.H.

Inheritance diagram for jevois::Engine:
Collaboration diagram for jevois::Engine:

Public Member Functions

 Engine (std::string const &instance)
 Constructor.
 
 Engine (int argc, char const *argv[], std::string const &instance)
 Constructor with command-line parsing.
 
 ~Engine ()
 Destructor.
 
void reloadVideoMappings ()
 Re-load video mappings from videomappings.cfg.
 
VideoMapping const & findVideoMapping (unsigned int oformat, unsigned int owidth, unsigned int oheight, float oframespersec) const
 Find the VideoMapping that has the given output specs, or throw if not found.
 
VideoMapping const & getCurrentVideoMapping () const
 Get the current video mapping.
 
size_t numVideoMappings () const
 Return the number of video mappings.
 
VideoMapping const & getVideoMapping (size_t idx) const
 Allow access to our video mappings which are parsed from file at construction.
 
size_t getVideoMappingIdx (unsigned int iformat, unsigned int iframe, unsigned int interval) const
 Get the video mapping index for a given UVC iformat, iframe and interval.
 
VideoMapping const & getDefaultVideoMapping () const
 Allow access to the default video mapping.
 
size_t getDefaultVideoMappingIdx () const
 Allow access to the default video mapping index.
 
void foreachVideoMapping (std::function< void(VideoMapping const &m)> &&func)
 Run a function on every video mapping.
 
void requestSetFormat (int idx)
 Use this to request a format change from within process()
 
void quit ()
 Terminate the program.
 
void reboot ()
 Request a reboot.
 
void setFormat (size_t idx)
 Callback for when the user selects a new output video format.
 
void streamOn ()
 Start streaming on video from camera, processing, and USB.
 
void streamOff ()
 Stop streaming on video from camera, processing, and USB.
 
int mainLoop ()
 Main loop: grab, process, send over USB. Should be called by main application thread.
 
void sendSerial (std::string const &str, bool islog=false)
 Send a string to all serial ports.
 
std::shared_ptr< Modulemodule () const
 Get a pointer to our current module (may be null)
 
std::shared_ptr< Cameracamera () const
 Get a pointer to our Camera (may be null, especially if not using a camera but, eg, movie input)
 
void drawCameraGUI ()
 Draw all camera controls into our GUI.
 
CameraCalibration loadCameraCalibration (std::string const &stem="calibration", bool do_throw=false)
 Helper to load an OpenCV camera matrix and distortion coeffs for the current running module.
 
void saveCameraCalibration (CameraCalibration const &calib, std::string const &stem="calibration")
 Helper to save an OpenCV camera matrix and distortion coeffs for the current running module.
 
void registerPythonComponent (Component *comp, void *pyinst)
 Register a component as linked to some python code, used by dynamic params created in python.
 
void unRegisterPythonComponent (Component *comp)
 Unregister a component as linked to some python code, used by dynamic params created in python.
 
ComponentgetPythonComponent (void *pyinst) const
 Get the component registered with a given python instance.
 
void reportError (std::string const &err)
 
void clearErrors ()
 Clear all errors currently displayed in the JeVois-Pro GUI.
 
void nextDemo ()
 When in demo mode, switch to next demo.
 
void abortDemo ()
 When in demo mode, abort demo mode.
 
- Public Member Functions inherited from jevois::Manager
 Manager (std::string const &instance="TheManager")
 Constructor without command-line args.
 
 Manager (int argc, char const *argv[], std::string const &instance="TheManager")
 Constructor.
 
void setCommandLineArgs (int argc, char const *argv[])
 Set the command-line arguments, call this before start() if args were not passed at construction.
 
virtual ~Manager ()
 Destructor.
 
template<class Comp , typename... Args>
std::shared_ptr< Comp > addComponent (std::string const &instanceName, Args &&...args)
 Pseudo-constructor: construct a top-level Component.
 
template<class Comp , typename... Args>
std::shared_ptr< Comp > addSubComponent (std::string const &instanceName, Args &&...args)=delete
 Use addComponent() on the Manager as opposed to jevois::Component::addSubComponent()
 
template<class Comp >
void removeComponent (std::shared_ptr< Comp > &component)
 Remove a top-level Component from the Manager, by shared_ptr.
 
template<class Comp >
void removeSubComponent (std::shared_ptr< Comp > &component)=delete
 Use removeComponent() on the Manager as opposed to jevois::Component::removeSubComponent()
 
void removeComponent (std::string const &instanceName, bool warnIfNotFound=true)
 Remove a top-level Component from the Manager, by instance name.
 
void removeSubComponent (std::string const &instanceName, bool warnIfNotFound)=delete
 Use removeComponent() on the Manager as opposed to jevois::Component::removeSubComponent()
 
template<class Comp = jevois::Component>
std::shared_ptr< Comp > getComponent (std::string const &instanceName) const
 Get a top-level component by instance name.
 
template<class Comp >
std::shared_ptr< Comp > getSubComponent (std::string const &instanceName) const =delete
 Use getComponent() on the Manager as opposed to jevois::Component::getSubComponent()
 
std::vector< std::string > const & remainingArgs () const
 Get the remaining arguments that were not parsed by the command line.
 
- Public Member Functions inherited from jevois::Component
 Component (std::string const &instance)
 Constructor.
 
virtual ~Component ()
 Virtual destructor for safe inheritance.
 
template<class Comp , typename... Args>
std::shared_ptr< Comp > addSubComponent (std::string const &instance, Args &&...args)
 Pseudo-constructor: construct and add another component as a subcomponent of this one.
 
template<class Comp >
void removeSubComponent (std::shared_ptr< Comp > &component)
 Remove a sub-Component from this Component, by shared_ptr.
 
void removeSubComponent (std::string const &instance, bool warnIfNotFound=true)
 Remove a sub-Component from this Component, by instance name.
 
template<class Comp = jevois::Component>
std::shared_ptr< Comp > getSubComponent (std::string const &instance) const
 Get a sub-component by instance name.
 
bool isTopLevel () const
 Returns true if this component is top-level, i.e., its parent is jevois::Manager.
 
bool initialized () const
 Has this component been initialized yet?
 
std::string const & className () const
 The class name of this component.
 
std::string const & instanceName () const
 The instance name of this component.
 
template<typename T >
std::vector< std::string > setParamVal (std::string const &paramdescriptor, T const &val)
 Set a parameter value.
 
template<typename T >
void setParamValUnique (std::string const &paramdescriptor, T const &val)
 Set a parameter value, simple version assuming only one parameter match.
 
template<typename T >
std::vector< std::pair< std::string, T > > getParamVal (std::string const &paramdescriptor) const
 Get parameter(s) value(s) by descriptor.
 
template<typename T >
getParamValUnique (std::string const &paramdescriptor) const
 Get a parameter value, simple version assuming only one parameter match.
 
std::vector< std::string > setParamString (std::string const &paramdescriptor, std::string const &val)
 Set a parameter value, by string.
 
void setParamStringUnique (std::string const &paramdescriptor, std::string const &val)
 Set a parameter value by string, simple version assuming only one parameter match.
 
std::vector< std::pair< std::string, std::string > > getParamString (std::string const &paramdescriptor) const
 Get a parameter value, by string.
 
std::string getParamStringUnique (std::string const &paramdescriptor) const
 Get a parameter value by string, simple version assuming only one parameter match.
 
void freezeParam (std::string const &paramdescriptor, bool doit)
 Freeze/unfreeze a parameter, by name, see ParameterBase::freeze()
 
void freezeAllParams (bool doit)
 Freeze all parameters.
 
std::string descriptor () const
 Get our full descriptor (including all parents) as [Instancename]:[...]:[...].
 
void setParamsFromFile (std::string const &filename)
 Set some parameters from a file.
 
std::istream & setParamsFromStream (std::istream &is, std::string const &absfile)
 Set some parameters from an open stream.
 
virtual void paramInfo (std::shared_ptr< UserInterface > s, std::map< std::string, std::string > &categs, bool skipFrozen, std::string const &cname="", std::string const &pfx="")
 Get machine-oriented descriptions of all parameters.
 
void foreachParam (std::function< void(std::string const &compname, ParameterBase *p)> func, std::string const &cname="")
 Run a function on every param we hold.
 
template<typename T >
std::shared_ptr< DynamicParameter< T > > addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ParameterCategory const &category)
 Add a new parameter after the Component has already been constructed.
 
template<typename T , template< typename > class ValidValuesSpec>
std::shared_ptr< DynamicParameter< T > > addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ValidValuesSpec< T > const &validValuesSpec, ParameterCategory const &category)
 Add a new parameter after the Component has already been constructed.
 
template<typename T >
void setDynamicParameterCallback (std::string const &name, std::function< void(T const &)> cb, bool callnow=true)
 Register a callback with a previously created dynamic parameter.
 
void removeDynamicParameter (std::string const &name, bool throw_if_not_found=true)
 Remove a previously added dynamic parameter.
 
void setPath (std::string const &path)
 Assign a filesystem path to this component.
 
std::filesystem::path absolutePath (std::filesystem::path const &path="")
 If given path is relative (not starting with /), prepend the Component path to it.
 
- Public Member Functions inherited from jevois::ParameterRegistry
virtual ~ParameterRegistry ()
 Virtual destructor for safe inheritance.
 

Protected Member Functions

void runScriptFromFile (std::string const &filename, std::shared_ptr< UserInterface > ser, bool throw_no_file)
 Run a script from file.
 
void onParamChange (engine::serialdev const &param, std::string const &newval) override
 Parameter callback.
 
void onParamChange (engine::usbserialdev const &param, std::string const &newval) override
 Parameter callback.
 
void onParamChange (engine::cpumode const &param, engine::CPUmode const &newval) override
 Parameter callback.
 
void onParamChange (engine::cpumax const &param, unsigned int const &newval) override
 Parameter callback.
 
void onParamChange (engine::videoerrors const &param, bool const &newval) override
 Parameter callback.
 
void onParamChange (engine::gui const &param, bool const &newval) override
 Parameter callback.
 
void onParamChange (engine::cpumaxl const &param, unsigned int const &newval) override
 Parameter callback.
 
void onParamChange (engine::cpumodel const &param, engine::CPUmode const &newval) override
 Parameter callback.
 
void onParamChange (engine::demomode const &param, float const &newval) override
 Parameter callback.
 
void preInit () override
 Override of Manager::preInit()
 
void postInit () override
 Override of Manager::postInit()
 
bool parseCommand (std::string const &str, std::shared_ptr< UserInterface > s, std::string const &pfx="")
 Parse a user command received over serial port.
 
- Protected Member Functions inherited from jevois::Manager
void onParamChange (manager::loglevel const &param, manager::LogLevel const &newval) override
 Parameter callback.
 
void onParamChange (manager::tracelevel const &param, unsigned int const &newval) override
 Parameter callback.
 
void preInit () override
 Calls parseCommandLine()
 
void postInit () override
 Checks for the –help flag.
 
void constructHelpMessage (std::ostream &out) const
 Constructs a help message from all parameters in the model, and outputs it to 'out'.
 
void printHelpMessage () const
 Constructs a help message and tries to send it to /usr/bin/less.
 
- Protected Member Functions inherited from jevois::Component
virtual void preUninit ()
 Called before all sub-Components are uninit()ed.
 
virtual void postUninit ()
 Called after all sub-Components are uninit()ed.
 
- Protected Member Functions inherited from jevois::ParameterRegistry
void addParameter (ParameterBase *const param)
 The Parameter class uses this method to register itself on construction with its owning Component.
 
void removeParameter (ParameterBase *const param)
 The Parameter class uses this method to un-register itself on destruction with its owning Component.
 
void callbackInitCall ()
 For all parameters that have a callback which has never been called, call it with the default param value.
 

Protected Attributes

size_t itsDefaultMappingIdx
 Index of default mapping.
 
std::vector< VideoMappingitsMappings
 All our mappings from videomappings.cfg.
 
VideoMapping itsCurrentMapping
 Current mapping, may not match any in itsMappings if setmapping2 used.
 
std::shared_ptr< VideoInputitsCamera
 Our camera.
 
std::shared_ptr< IMUitsIMU
 
std::shared_ptr< VideoOutputitsGadget
 Our IMU.
 
std::unique_ptr< DynamicLoaderitsLoader
 Our module loader.
 
std::shared_ptr< ModuleitsModule
 Our current module.
 
std::atomic< bool > itsRunning
 True when we are running.
 
std::atomic< bool > itsStreaming
 True when we are streaming video.
 
std::atomic< bool > itsStopMainLoop
 Flag used to stop the main loop.
 
std::timed_mutex itsMtx
 Mutex to protect our internals.
 

Related Symbols

(Note that these are not member symbols.)

size_t frameNum ()
 Get the current video processing frame number.
 
 JEVOIS_DECLARE_PARAMETER (cameradev, std::string, "Camera device name (if starting with /dev/v...), or movie " "file name (e.g., movie.mpg) or image sequence (e.g., im%02d.jpg, to read frames " "im00.jpg, im01.jpg, etc).", JEVOIS_CAMERA_DEFAULT, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (camerasens, CameraSensor, "Camera sensor. Users would usually not set this parameter " "manually, it is set through boot-time configuration.", JEVOIS_CAMERASENS_DEFAULT, CameraSensor_Values, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (cameralens, CameraLens, "Camera lens. Users should usually not set this parameter " "using the global JeVois params.cfg config file.", CameraLens::standard, CameraLens_Values, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (cameranbuf, unsigned int, "Number of video input (camera) buffers, or 0 for automatic.", 0, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (gadgetdev, std::string, "Gadget device name. This is used on platform hardware only. " "On host hardware, a display window will be used unless gadgetdev is None (useful " "for benchmarking) or is a file stem for a movie file that does not start with /dev/ " "(and which should contain a printf-style directive for a single int argument, " "the movie number).", JEVOIS_GADGET_DEFAULT, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (gadgetnbuf, unsigned int, "Number of video output (USB video) buffers, or 0 for auto", 0, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (videomapping, int, "Index of Video Mapping to use, or -1 to use the default mapping. " "Note that this parameter is only available when parsing command-line arguments. " "At runtime, the setmapping command should be used instead.", -1, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (serialmonitors, bool, "If true, serial port monitors will be enabled " "in the GUI, which can be used to peek at serial communications not " "directed to the console. Can be turned off at start time (e.g., in the " "global JeVois params.cfg) as there is some small CPU cost to it.", true, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (serialdev, std::string, "Hardware (4-pin connector) serial device name, " "or 'stdio' to use the console, or empty for no hardware serial port", JEVOIS_SERIAL_DEFAULT, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (usbserialdev, std::string, "Over-the-USB serial device name, or empty", JEVOIS_USBSERIAL_DEFAULT, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (camreg, bool, "Enable raw access to camera registers through setcamreg and getcamreg", false, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (imureg, bool, "Enable raw access to IMU registers through setimureg and getimureg", false, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (camturbo, bool, "Enable camera turbo mode by relaxing the need for DMA-coherent video " "buffer memory. This can accelerate severalfolds access to the captured image data, but " "it may also yield stripe artifacts with some modules, such as PassThrough. The stripes " "are pieces of incorrect data in the cache. You should experiment with each particular " "module. Turbo mode is not recommended for any production-grade application.", false, ParamCateg)
 Parameter.
 
 JEVOIS_DEFINE_ENUM_CLASS (SerPort,(None)(All)(Hard)(USB))
 Enum for Parameter.
 
 JEVOIS_DECLARE_PARAMETER (serlog, SerPort, "Show log and debug messages on selected serial port(s)", SerPort::None, SerPort_Values, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (videoerrors, bool, "Show any machine vision module errors (exceptions) " "in the video stream. Only takes effect if streaming video to USB.", true, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (serout, SerPort, "Send module serial messages to selected serial port(s)", SerPort::None, SerPort_Values, ParamCateg)
 Parameter.
 
 JEVOIS_DEFINE_ENUM_CLASS (CPUmode,(PowerSave)(Conservative)(OnDemand)(Interactive)(Performance))
 Enum for Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (cpumode, CPUmode, "CPU frequency modulation mode" " for A73 big cores", CPUmode::Performance, CPUmode_Values, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (cpumodel, CPUmode, "CPU frequency modulation mode for A53 little cores", CPUmode::Performance, CPUmode_Values, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (cpumax, unsigned int, "CPU maximum frequency in MHz" ". To enable overclock frequencies above 2208 MHz, you need to first edit " "/boot/env.txt and change max_freq_a73, then reboot. Use with caution!", 2208, { 500, 667, 1000, 1200, 1398, 1512, 1608, 1704, 1800, 1908, 2016, 2100, 2208, 2304, 2400 }, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (cpumaxl, unsigned int, "CPU maximum frequency in MHz, for A53 little cores. " "To enable overclock frequencies above 1800 MHz, you need to first edit " "/boot/env.txt and change max_freq_a53, then reboot. Use with caution!", 1800, { 500, 667, 1000, 1200, 1398, 1512, 1608, 1704, 1800, 1908, 2016, 2100, 2208 }, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (multicam, bool, "Allow up to 3 JeVois cameras on one USB bus. Enabling this " "reduces the amount of USB bandwidth used by each JeVois camera, from 3kb " "per USB isochronous microframe to 1kb. All 3 JeVois cameras must have this " "option enabled, and the JeVois linux kernel module should also have " "been loaded with multicam on.", false, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (quietcmd, bool, "When true, do not issue a message 'OK' after every correct command " "received at the command-line interface. Recommended for advanced users only.", false, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (python, bool, "When true, enable support for modules written in Python. Otherwise, " "attempting to load a python module will throw an exception. Disabling python saves " "a lot of memory and may be useful when using C++ modules that run large deep neural " "networks.", true, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (serlimit, size_t, "Maximum number of serial messages that can be sent by a module " "using sendSerial(), for each video frame, or 0 for no limit. Any message sent by " "the module beyond the first serlimit ones will be dropped. This is useful to avoid " "overloading the serial link, for example in case one is running a ArUco detector and " "a large number of ArUco tags are present in the field of view of JeVois.", 0, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (gui, bool, "Use a graphical user interface instead of plain display " "when true", true, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (conslock, bool, "Lock the console and capture the keyboard and mouse to avoid " "interference, only effective on JeVois-Pro Platform, otherwise ignored. Set conslock " "to false if you are experiencing hard crashes and want to run jevoispro-daemon in gdb.", true, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (watchdog, double, "Timeout in seconds after which we kill this process if the main loop " "is stuck somehow, or 0.0 for no watchdog", 10.0, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (demomode, float, "Show a demonstration of some available JeVois-Pro " "machine vision modules, cycling to the next modules after a number " "of seconds specified by this parameter (or 0.0 for no demo mode).", 0.0F, ParamCateg)
 Parameter.
 

Constructor & Destructor Documentation

◆ Engine() [1/2]

jevois::Engine::Engine ( std::string const &  instance)

Constructor.

Definition at line 221 of file Engine.C.

References jevois::async_little(), and JEVOIS_TRACE.

◆ Engine() [2/2]

jevois::Engine::Engine ( int  argc,
char const *  argv[],
std::string const &  instance 
)

Constructor with command-line parsing.

Definition at line 239 of file Engine.C.

References jevois::async_little(), and JEVOIS_TRACE.

◆ ~Engine()

jevois::Engine::~Engine ( )

Destructor.

Definition at line 830 of file Engine.C.

References JEVOIS_TIMED_LOCK, JEVOIS_TRACE, jevois::logSetEngine(), and jevois::warnAndIgnoreException().

Member Function Documentation

◆ abortDemo()

void jevois::Engine::abortDemo ( )

When in demo mode, abort demo mode.

Definition at line 604 of file Engine.C.

Referenced by jevois::GUIhelper::endFrame().

◆ camera()

std::shared_ptr< jevois::Camera > jevois::Engine::camera ( ) const

Get a pointer to our Camera (may be null, especially if not using a camera but, eg, movie input)

Definition at line 1466 of file Engine.C.

◆ clearErrors()

void jevois::Engine::clearErrors ( )

Clear all errors currently displayed in the JeVois-Pro GUI.

In the JevoisPro GUI, errors reported via reportError() remain displayed for a few seconds, but sometimes we want to clear them right away, e.g., after DNN pipeline threw, if the user selects another one, we want the previous error to disappear immediately since it is not applicable anymore. When the JeVois-Pro GUI is not used, this has no effect.

Definition at line 1400 of file Engine.C.

Referenced by jevois::dnn::Pipeline::onParamChange().

◆ drawCameraGUI()

void jevois::Engine::drawCameraGUI ( )

Draw all camera controls into our GUI.

Definition at line 2859 of file Engine.C.

Referenced by jevois::GUIhelper::drawCamCtrls().

◆ findVideoMapping()

jevois::VideoMapping const & jevois::Engine::findVideoMapping ( unsigned int  oformat,
unsigned int  owidth,
unsigned int  oheight,
float  oframespersec 
) const

Find the VideoMapping that has the given output specs, or throw if not found.

Definition at line 1586 of file Engine.C.

References jevois::fccstr(), LFATAL, and jevois::VideoMapping::match().

◆ foreachVideoMapping()

void jevois::Engine::foreachVideoMapping ( std::function< void(VideoMapping const &m)> &&  func)

Run a function on every video mapping.

The first mapping your function will be called on is for mapping with index 0, and so on until index numVideoMappings()-1. If your function throws, we report the exception and then ignore it, then we move on to the next mapping.

Definition at line 1578 of file Engine.C.

References jevois::warnAndIgnoreException().

Referenced by jevois::GUIhelper::runNewModule().

◆ getCurrentVideoMapping()

jevois::VideoMapping const & jevois::Engine::getCurrentVideoMapping ( ) const

Get the current video mapping.

Note that the current mapping may not have an entry in our list of mappings obtained from videomappings.cfg, if the current one was set on the fly by the setmapping2 CLI command.

Definition at line 1522 of file Engine.C.

Referenced by jevois::GUIhelper::drawInfo(), and jevois::GUIhelper::resetstate().

◆ getDefaultVideoMapping()

jevois::VideoMapping const & jevois::Engine::getDefaultVideoMapping ( ) const

Allow access to the default video mapping.

Definition at line 1570 of file Engine.C.

Referenced by jevois::Gadget::Gadget().

◆ getDefaultVideoMappingIdx()

size_t jevois::Engine::getDefaultVideoMappingIdx ( ) const

Allow access to the default video mapping index.

Definition at line 1574 of file Engine.C.

◆ getPythonComponent()

jevois::Component * jevois::Engine::getPythonComponent ( void *  pyinst) const

Get the component registered with a given python instance.

Use with extreme caution to guarantee thread safety and object lifetime since we just use raw pointers here

Definition at line 3015 of file Engine.C.

References LDEBUG, and LFATAL.

◆ getVideoMapping()

jevois::VideoMapping const & jevois::Engine::getVideoMapping ( size_t  idx) const

Allow access to our video mappings which are parsed from file at construction.

Definition at line 1530 of file Engine.C.

References LFATAL.

◆ getVideoMappingIdx()

size_t jevois::Engine::getVideoMappingIdx ( unsigned int  iformat,
unsigned int  iframe,
unsigned int  interval 
) const

Get the video mapping index for a given UVC iformat, iframe and interval.

Definition at line 1539 of file Engine.C.

References LFATAL, jevois::VideoMapping::ofps, jevois::VideoMapping::uvcformat, jevois::VideoMapping::uvcframe, and jevois::VideoMapping::uvcToFps().

◆ loadCameraCalibration()

jevois::CameraCalibration jevois::Engine::loadCameraCalibration ( std::string const &  stem = "calibration",
bool  do_throw = false 
)

Helper to load an OpenCV camera matrix and distortion coeffs for the current running module.

If do_throw is false, just report an error and provide identity defaults if calibration mot found. This would typically be called in preInit() or postInit() of any module that will need the calibration parameters. Note: for thread safety, engine should be locked; calling this inside Module::process() is safe.

Definition at line 1470 of file Engine.C.

References jevois::CameraCalibration::h, h, JEVOIS_SHARE_PATH, jevois::CameraCalibration::lens, LFATAL, LINFO, jevois::CameraCalibration::load(), jevois::CameraCalibration::sensor, and jevois::CameraCalibration::w.

◆ mainLoop()

int jevois::Engine::mainLoop ( )

◆ module()

std::shared_ptr< jevois::Module > jevois::Engine::module ( ) const

Get a pointer to our current module (may be null)

Definition at line 1458 of file Engine.C.

Referenced by jevois::GUIhelper::drawConsole(), jevois::GUIhelper::drawInfo(), and jevois::GUIhelper::drawParameters().

◆ nextDemo()

void jevois::Engine::nextDemo ( )

When in demo mode, switch to next demo.

Definition at line 600 of file Engine.C.

Referenced by jevois::GUIhelper::endFrame().

◆ numVideoMappings()

size_t jevois::Engine::numVideoMappings ( ) const

Return the number of video mappings.

Definition at line 1526 of file Engine.C.

◆ onParamChange() [1/9]

void jevois::Engine::onParamChange ( engine::cpumax const &  param,
unsigned int const &  newval 
)
overrideprotected

Parameter callback.

◆ onParamChange() [2/9]

void jevois::Engine::onParamChange ( engine::cpumaxl const &  param,
unsigned int const &  newval 
)
overrideprotected

Parameter callback.

◆ onParamChange() [3/9]

void jevois::Engine::onParamChange ( engine::cpumode const &  param,
engine::CPUmode const &  newval 
)
overrideprotected

Parameter callback.

◆ onParamChange() [4/9]

void jevois::Engine::onParamChange ( engine::cpumodel const &  param,
engine::CPUmode const &  newval 
)
overrideprotected

Parameter callback.

◆ onParamChange() [5/9]

void jevois::Engine::onParamChange ( engine::demomode const &  param,
float const &  newval 
)
overrideprotected

Parameter callback.

◆ onParamChange() [6/9]

void jevois::Engine::onParamChange ( engine::gui const &  param,
bool const &  newval 
)
overrideprotected

Parameter callback.

◆ onParamChange() [7/9]

void jevois::Engine::onParamChange ( engine::serialdev const &  param,
std::string const &  newval 
)
overrideprotected

Parameter callback.

◆ onParamChange() [8/9]

void jevois::Engine::onParamChange ( engine::usbserialdev const &  param,
std::string const &  newval 
)
overrideprotected

Parameter callback.

◆ onParamChange() [9/9]

void jevois::Engine::onParamChange ( engine::videoerrors const &  param,
bool const &  newval 
)
overrideprotected

Parameter callback.

◆ parseCommand()

bool jevois::Engine::parseCommand ( std::string const &  str,
std::shared_ptr< UserInterface s,
std::string const &  pfx = "" 
)
protected

Parse a user command received over serial port.

Throw upon receiving an incorrect command (eg, bad parameter value), return true if success, return false if command was not recognized and should be tried by Module. pfx is an optional prefix which will be added to all produced messages or errors.

Definition at line 1971 of file Engine.C.

References jevois::getSysInfoCPU(), jevois::getSysInfoMem(), jevois::getSysInfoVersion(), JEVOIS_CUSTOM_DNN_PATH, JEVOIS_CUSTOM_DNN_URL, JEVOIS_USBSD_SYS, JEVOIS_VERSION_STRING, JEVOISPRO_FMT_GUI, LDEBUG, jevois::split(), and jevois::system().

◆ postInit()

◆ preInit()

void jevois::Engine::preInit ( )
overrideprotectedvirtual

Override of Manager::preInit()

Reimplemented from jevois::Component.

Definition at line 617 of file Engine.C.

References JEVOIS_CONFIG_PATH, JEVOIS_MODULE_PARAMS_FILENAME, and jevois::Manager::preInit().

◆ quit()

void jevois::Engine::quit ( )

Terminate the program.

Definition at line 1869 of file Engine.C.

Referenced by jevois::GUIhelper::drawMenuBar(), and jevois::GUIhelper::startFrame().

◆ reboot()

void jevois::Engine::reboot ( )

Request a reboot.

On JeVois-A33 Platform, trigger a hard reset. On JeVois-Pro Platform or JeVois-Host, just terminate the program.

Definition at line 1848 of file Engine.C.

References LERROR.

◆ registerPythonComponent()

void jevois::Engine::registerPythonComponent ( jevois::Component comp,
void *  pyinst 
)

Register a component as linked to some python code, used by dynamic params created in python.

Use with extreme caution to guarantee thread safety and object lifetime since we just use raw pointers here

Definition at line 2996 of file Engine.C.

References jevois::Component::instanceName(), LDEBUG, and LFATAL.

◆ reloadVideoMappings()

void jevois::Engine::reloadVideoMappings ( )

Re-load video mappings from videomappings.cfg.

Mappings are automatically loaded on startup so this should only be used if the file has been modified and the mappings need to be refreshed. Note that this will not refresh the available resolutions for USB output, which requires a full reboot to re-initialize the kernel Gadget module. Also beware of possible state inconsistency (e.g., if external code is holding a reference previously returned by findVideoMapping(). So, use with caution. Basically, only GUIhelper should use this.

Definition at line 628 of file Engine.C.

References LINFO.

Referenced by jevois::GUIhelper::compileModule(), and jevois::GUIhelper::runNewModule().

◆ reportError()

void jevois::Engine::reportError ( std::string const &  err)

Try to minimize the use of this function, and normally use LERROR() or LFATAL() instead. Currently the only use is in jevois::dnn::Pipeline, to report parameters set in the zoo file but not used by the pipeline, as issuing an LFATAL() for that may be too strict, but issuing an LERROR() may go un-noticed since the pipeline is still running just fine.

Definition at line 1391 of file Engine.C.

References LERROR.

◆ requestSetFormat()

void jevois::Engine::requestSetFormat ( int  idx)

Use this to request a format change from within process()

This should only be used on JeVois-Pro in GUI mode. The engine is locked up hence and setFormat() cannot be called from within a Module's process function, to avoid possible disasters of changing format while we process. Modules or the GUI can use requestSetFormat() to request a format change in between two calls to process(). Note special values: -1 to just reload the current format (e.g., after editing code), -2 does nothing.

Definition at line 932 of file Engine.C.

References JEVOIS_TRACE.

Referenced by jevois::GUIhelper::runNewModule().

◆ runScriptFromFile()

void jevois::Engine::runScriptFromFile ( std::string const &  filename,
std::shared_ptr< UserInterface ser,
bool  throw_no_file 
)
protected

Run a script from file.

The filename should be absolute. The file should have any of the commands supported by Engine, one per line. Filename should be relative to the current module's path.

Definition at line 2781 of file Engine.C.

References jevois::UserInterface::GUI, jevois::UserInterface::Hard, LFATAL, jevois::strip(), jevois::UserInterface::USB, and jevois::warnAndIgnoreException().

◆ saveCameraCalibration()

void jevois::Engine::saveCameraCalibration ( jevois::CameraCalibration const &  calib,
std::string const &  stem = "calibration" 
)

Helper to save an OpenCV camera matrix and distortion coeffs for the current running module.

Note: for thread safety, engine should be locked; calling this inside Module::process() is safe.

Definition at line 1508 of file Engine.C.

References jevois::CameraCalibration::h, JEVOIS_SHARE_PATH, jevois::CameraCalibration::lens, LINFO, jevois::CameraCalibration::save(), jevois::CameraCalibration::sensor, jevois::to_string(), and jevois::CameraCalibration::w.

◆ sendSerial()

void jevois::Engine::sendSerial ( std::string const &  str,
bool  islog = false 
)

Send a string to all serial ports.

Note
When islog is true, this is assumes to be a log message, and it will be sent to the port(s) specified by parameter serlog. Otherwise, the message will be sent to the ports specified by parameter serout. Note how the number of messages that can be sent for each video frame may be limited by parameter serlimit; only up to serlimit messages will be sent for a given video frame. This is useful to avoid overloading the serial link, for example in cases one is running a ArUco detector and a large number of ArUco tags are present in the field of view of JeVois.

Definition at line 1346 of file Engine.C.

References jevois::UserInterface::GUI, jevois::UserInterface::Hard, jevois::UserInterface::USB, and jevois::warnAndIgnoreException().

Referenced by jevois::Module::sendSerial().

◆ setFormat()

void jevois::Engine::setFormat ( size_t  idx)

Callback for when the user selects a new output video format.

Here, we stop streaming, nuke any current processing module, set the camera format, set the gadget output format, load the new processing module, and start streaming again. The given VideoMapping will typically be obtained using findVideoMapping() from output specs received over the USB link.

Definition at line 939 of file Engine.C.

References JEVOIS_TIMED_LOCK, JEVOIS_TRACE, LDEBUG, and LFATAL.

◆ streamOff()

void jevois::Engine::streamOff ( )

Stop streaming on video from camera, processing, and USB.

Definition at line 911 of file Engine.C.

References JEVOIS_TIMED_LOCK, JEVOIS_TRACE, and LDEBUG.

◆ streamOn()

void jevois::Engine::streamOn ( )

Start streaming on video from camera, processing, and USB.

Definition at line 900 of file Engine.C.

References JEVOIS_TIMED_LOCK, and JEVOIS_TRACE.

Referenced by main().

◆ unRegisterPythonComponent()

void jevois::Engine::unRegisterPythonComponent ( Component comp)

Unregister a component as linked to some python code, used by dynamic params created in python.

Use with extreme caution to guarantee thread safety and object lifetime since we just use raw pointers here

Definition at line 3006 of file Engine.C.

References jevois::Component::instanceName(), and LDEBUG.

Friends And Related Symbol Documentation

◆ frameNum()

size_t frameNum ( )
related

Get the current video processing frame number.

The Engine maintains a master frame counter that is incremented on each call to a Module's process(), whether or not the call succeeds. The counter is not incremented when a module has not been loaded (e.g., failed to load). The counter is reset to zero each time a new module is loaded.

This is implemented as a free function so that anyone can access it:

size_t current_frame_number = jevois::frameNum();

It is thread-safe. Programmer note: the implementation is in Engine.C since Engine is the one that manages the counter. It is declared here so that users don't have to include Engine.H

◆ JEVOIS_DECLARE_PARAMETER() [1/19]

JEVOIS_DECLARE_PARAMETER ( cameradev  ,
std::string  ,
"Camera device name   if starting with /dev/v...,
or movie " "file name(e.g., movie.mpg) or image sequence(e.g., im%02d.jpg, to read frames " "im00.jpg, im01.jpg, etc)."  ,
JEVOIS_CAMERA_DEFAULT  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [2/19]

JEVOIS_DECLARE_PARAMETER ( cameralens  ,
CameraLens  ,
"Camera lens. Users should usually not set this parameter " "using the global JeVois params.cfg config file."  ,
CameraLens::standard  ,
CameraLens_Values  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [3/19]

JEVOIS_DECLARE_PARAMETER ( cameranbuf  ,
unsigned int  ,
"Number of video input (camera buffers,
or 0 for automatic."  ,
,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [4/19]

JEVOIS_DECLARE_PARAMETER ( camerasens  ,
CameraSensor  ,
"Camera sensor. Users would usually not set this parameter " "  manually,
it is set through boot-time configuration."  ,
JEVOIS_CAMERASENS_DEFAULT  ,
CameraSensor_Values  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [5/19]

JEVOIS_DECLARE_PARAMETER ( camreg  ,
bool  ,
"Enable raw access to camera registers through setcamreg and getcamreg"  ,
false  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [6/19]

JEVOIS_DECLARE_PARAMETER ( camturbo  ,
bool  ,
"Enable camera turbo mode by relaxing the need for DMA-coherent video " "buffer memory. This can accelerate severalfolds access to the captured image  data,
but " "it may also yield stripe artifacts with some  modules,
such as PassThrough. The stripes " "are pieces of incorrect data in the cache. You should experiment with each particular " "module. Turbo mode is not recommended for any production-grade application."  ,
false  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [7/19]

JEVOIS_DECLARE_PARAMETER ( conslock  ,
bool  ,
"Lock the console and capture the keyboard and mouse to avoid " "  interference,
only effective on JeVois-Pro  Platform,
otherwise ignored. Set conslock " "to false if you are experiencing hard crashes and want to run jevoispro-daemon in gdb."  ,
true  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [8/19]

JEVOIS_DECLARE_PARAMETER ( gadgetdev  ,
std::string  ,
"Gadget device name. This is used on platform hardware only. " "On host  hardware,
a display window will be used unless gadgetdev is None(useful " "for benchmarking) or is a file stem for a movie file that does not start with/dev/" "(and which should contain a printf-style directive for a single int argument, " "the movie number)."  ,
JEVOIS_GADGET_DEFAULT  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [9/19]

JEVOIS_DECLARE_PARAMETER ( gadgetnbuf  ,
unsigned int  ,
"Number of video output (USB video)  buffers,
or 0 for auto"  ,
,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [10/19]

JEVOIS_DECLARE_PARAMETER ( imureg  ,
bool  ,
"Enable raw access to IMU registers through setimureg and getimureg"  ,
false  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [11/19]

JEVOIS_DECLARE_PARAMETER ( multicam  ,
bool  ,
"Allow up to 3 JeVois cameras on one USB bus. Enabling this " "reduces the amount of USB bandwidth used by each JeVois  camera,
from 3kb " "per USB isochronous microframe to 1kb. All 3 JeVois cameras must have this " "option  enabled,
and the JeVois linux kernel module should also have " "been loaded with multicam on."  ,
false  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [12/19]

JEVOIS_DECLARE_PARAMETER ( python  ,
bool  ,
"When  true,
enable support for modules written in Python.  Otherwise,
" "attempting to load a python module will throw an exception. Disabling python saves " "a lot of memory and may be useful when using C++modules that run large deep neural " "networks."  ,
true  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [13/19]

JEVOIS_DECLARE_PARAMETER ( quietcmd  ,
bool  ,
"When  true,
do not issue a message 'OK' after every correct command " "received at the command-line interface. Recommended for advanced users only."  ,
false  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [14/19]

JEVOIS_DECLARE_PARAMETER ( serialmonitors  ,
bool  ,
"If  true,
serial port monitors will be enabled " "in the  GUI,
which can be used to peek at serial communications not " "directed to the console. Can be turned off at start time(e.g., in the " "global JeVois params.cfg) as there is some small CPU cost to it."  ,
true  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [15/19]

JEVOIS_DECLARE_PARAMETER ( serlimit  ,
size_t  ,
"Maximum number of serial messages that can be sent by a module " "using   sendSerial(),
for each video  frame,
or 0 for no limit. Any message sent by " "the module beyond the first serlimit ones will be dropped. This is useful to avoid " "overloading the serial  link,
for example in case one is running a ArUco detector and " "a large number of ArUco tags are present in the field of view of JeVois."  ,
,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [16/19]

JEVOIS_DECLARE_PARAMETER ( serlog  ,
SerPort  ,
"Show log and debug messages on selected serial port(s)"  ,
SerPort::None  ,
SerPort_Values  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [17/19]

JEVOIS_DECLARE_PARAMETER ( serout  ,
SerPort  ,
"Send module serial messages to selected serial port(s)"  ,
SerPort::None  ,
SerPort_Values  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [18/19]

JEVOIS_DECLARE_PARAMETER ( videomapping  ,
int  ,
"Index of Video Mapping to  use,
or -1 to use the default mapping. " "Note that this parameter is only available when parsing command-line arguments. " "At  runtime,
the setmapping command should be used instead."  ,
1,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [19/19]

JEVOIS_DECLARE_PARAMETER ( watchdog  ,
double  ,
"Timeout in seconds after which we kill this process if the main loop " "is stuck  somehow,
or 0.0 for no watchdog"  ,
10.  0,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [1/9]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( cpumax  ,
unsigned int  ,
"CPU maximum frequency in MHz" ". To enable overclock frequencies above 2208  MHz,
you need to first edit " "/boot/env.txt and change  max_freq_a73,
then reboot. Use with caution!"  ,
2208  ,
{ 500, 667, 1000, 1200, 1398, 1512, 1608, 1704, 1800, 1908, 2016, 2100, 2208, 2304, 2400 }  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [2/9]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( cpumaxl  ,
unsigned int  ,
"CPU maximum frequency in  MHz,
for A53 little cores. " "To enable overclock frequencies above 1800  MHz,
you need to first edit " "/boot/env.txt and change  max_freq_a53,
then reboot. Use with caution!"  ,
1800  ,
{ 500, 667, 1000, 1200, 1398, 1512, 1608, 1704, 1800, 1908, 2016, 2100, 2208 }  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [3/9]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( cpumode  ,
CPUmode  ,
"CPU frequency modulation mode" " for A73 big cores"  ,
CPUmode::Performance  ,
CPUmode_Values  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [4/9]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( cpumodel  ,
CPUmode  ,
"CPU frequency modulation mode for A53 little cores"  ,
CPUmode::Performance  ,
CPUmode_Values  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [5/9]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( demomode  ,
float  ,
"Show a demonstration of some available JeVois-Pro " "machine vision  modules,
cycling to the next modules after a number " "of seconds specified by this parameter(or 0.0 for no demo mode)."  ,
0.  0F,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [6/9]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( gui  ,
bool  ,
"Use a graphical user interface instead of plain display " "when true"  ,
true  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [7/9]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( serialdev  ,
std::string  ,
"Hardware (4-pin connector) serial device  name,
" "or 'stdio' to use the  console,
or empty for no hardware serial port"  ,
JEVOIS_SERIAL_DEFAULT  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [8/9]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( usbserialdev  ,
std::string  ,
"Over-the-USB serial device  name,
or empty"  ,
JEVOIS_USBSERIAL_DEFAULT  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [9/9]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( videoerrors  ,
bool  ,
"Show any machine vision module errors (exceptions) " "in the video stream. Only takes effect if streaming video to USB."  ,
true  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DEFINE_ENUM_CLASS() [1/2]

JEVOIS_DEFINE_ENUM_CLASS ( CPUmode  ,
(PowerSave)(Conservative)(OnDemand)(Interactive)(Performance)   
)
related

Enum for Parameter.

◆ JEVOIS_DEFINE_ENUM_CLASS() [2/2]

JEVOIS_DEFINE_ENUM_CLASS ( SerPort  ,
(None)(All)(Hard)(USB)   
)
related

Enum for Parameter.

Member Data Documentation

◆ itsCamera

std::shared_ptr<VideoInput> jevois::Engine::itsCamera
protected

Our camera.

Definition at line 601 of file Engine.H.

◆ itsCurrentMapping

VideoMapping jevois::Engine::itsCurrentMapping
protected

Current mapping, may not match any in itsMappings if setmapping2 used.

Definition at line 599 of file Engine.H.

◆ itsDefaultMappingIdx

size_t jevois::Engine::itsDefaultMappingIdx
protected

Index of default mapping.

Definition at line 597 of file Engine.H.

◆ itsGadget

std::shared_ptr<VideoOutput> jevois::Engine::itsGadget
protected

Our IMU.

Our gadget

Definition at line 603 of file Engine.H.

◆ itsIMU

std::shared_ptr<IMU> jevois::Engine::itsIMU
protected

Definition at line 602 of file Engine.H.

◆ itsLoader

std::unique_ptr<DynamicLoader> jevois::Engine::itsLoader
protected

Our module loader.

Definition at line 605 of file Engine.H.

◆ itsMappings

std::vector<VideoMapping> jevois::Engine::itsMappings
protected

All our mappings from videomappings.cfg.

Definition at line 598 of file Engine.H.

◆ itsModule

std::shared_ptr<Module> jevois::Engine::itsModule
protected

Our current module.

Definition at line 606 of file Engine.H.

◆ itsMtx

std::timed_mutex jevois::Engine::itsMtx
mutableprotected

Mutex to protect our internals.

Definition at line 612 of file Engine.H.

◆ itsRunning

std::atomic<bool> jevois::Engine::itsRunning
protected

True when we are running.

Definition at line 608 of file Engine.H.

◆ itsStopMainLoop

std::atomic<bool> jevois::Engine::itsStopMainLoop
protected

Flag used to stop the main loop.

Definition at line 610 of file Engine.H.

◆ itsStreaming

std::atomic<bool> jevois::Engine::itsStreaming
protected

True when we are streaming video.

Definition at line 609 of file Engine.H.


The documentation for this class was generated from the following files: