JeVois  1.21
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
Loading...
Searching...
No Matches
Config.H
Go to the documentation of this file.
1// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2//
3// JeVois Neuromorphic Embedded Vision Toolkit - Copyright (C) 2016 by Laurent Itti, the University of Southern
4// California (USC), and iLab at USC. See http://iLab.usc.edu and http://jevois.org for information about this project.
5//
6// This file is part of the JeVois Neuromorphic Embedded Vision Toolkit. This program is free software; you can
7// redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software
8// Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
10// License for more details. You should have received a copy of the GNU General Public License along with this program;
11// if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
12//
13// Contact information: Laurent Itti - 3641 Watt Way, HNB-07A - Los Angeles, CA 90089-2520 - USA.
14// Tel: +1 213 740 3527 - itti@pollux.usc.edu - http://iLab.usc.edu - http://jevois.org
15// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
16
17#pragma once
18
19//! Variables set by CMake
20#define JEVOIS_VERSION_MAJOR 1
21#define JEVOIS_VERSION_MINOR 21
22#define JEVOIS_VERSION_PATCH 0
23#define JEVOIS_VENDOR "JeVois"
24/* #undef JEVOIS_PLATFORM */
25/* #undef JEVOIS_LDEBUG_ENABLE */
26/* #undef JEVOIS_TRACE_ENABLE */
27/* #undef JEVOIS_USE_SYNC_LOG */
28/* #undef JEVOIS_LOG_TO_FILE */
29#define JEVOIS_OPENCV_MAJOR 4
30#define JEVOIS_OPENCV_MINOR 10
31#define JEVOIS_OPENCV_PATCH 0
32#define JEVOIS_PYTHON_MAJOR 3
33#define JEVOIS_PYTHON_MINOR 12
34
35//! Target hardware selection:
36#define JEVOIS_A33
37/* #undef JEVOIS_PRO */
38
39//! Shortcuts to allow detection of a specific platform instead of testing JEVOIS_PLATFORM and JEVOIS_[A33|PRO|...]
40/*! Use \#ifdef JEVOIS_PLATFORM_A33 as you would \#if defined(JEVOIS_PLATFORM) && defined(JEVOIS_A33).
41 Use \#ifdef JEVOIS_HOST_A33 as you would \#if !defined(JEVOIS_PLATFORM) && defined(JEVOIS_A33) */
42#if defined(JEVOIS_PLATFORM)
43# if defined(JEVOIS_PRO)
44# define JEVOIS_PLATFORM_PRO
45# else
46# define JEVOIS_PLATFORM_A33
47# endif
48#else
49#define JEVOIS_HOST
50# if defined(JEVOIS_PRO)
51# define JEVOIS_HOST_PRO
52# else
53# define JEVOIS_HOST_A33
54# endif
55#endif
56
57//! Helper string that evaluates to "jevois" or "jevoispro" depending on values of JEVOIS_A33 and JEVOIS_PRO:
58#define JEVOIS "jevois"
59
60//! Software version, combined
61#define JEVOIS_VERSION ( ((JEVOIS_VERSION_MAJOR) << 16) + ((JEVOIS_VERSION_MINOR) << 8) + (JEVOIS_VERSION_PATCH) )
62
63//! Macro to stringify a value
64#define JEVOIS_MACRO_STRING(s) JEVOIS_MACRO_STR(s)
65
66//! Macro to stringify a value
67#define JEVOIS_MACRO_STR(s) #s
68
69//! Software version, as string
70#define JEVOIS_VERSION_STRING JEVOIS_MACRO_STRING(JEVOIS_VERSION_MAJOR) "." JEVOIS_MACRO_STRING(JEVOIS_VERSION_MINOR) "." JEVOIS_MACRO_STRING(JEVOIS_VERSION_PATCH)
71
72//! Root path for runtime jevois config files, videomappings.cfg, modules, etc
73#define JEVOIS_ROOT_PATH "/jevois"
74
75//! Base path for modules
76#define JEVOIS_MODULE_PATH JEVOIS_ROOT_PATH "/modules"
77
78//! Base path for config files
79#define JEVOIS_CONFIG_PATH JEVOIS_ROOT_PATH "/config"
80
81//! Base path for shared files (e.g., neural network weights, etc)
82#define JEVOIS_SHARE_PATH JEVOIS_ROOT_PATH "/share"
83
84//! Directory where custom DNN models are stored:
85#define JEVOIS_CUSTOM_DNN_PATH JEVOIS_SHARE_PATH "/dnn/custom"
86
87//! Directory where python pre/net/post DNN processors are stored:
88#define JEVOIS_PYDNN_PATH JEVOIS_SHARE_PATH "/pydnn"
89
90//! URL where custom converted DNN models can be downloaded:
91#define JEVOIS_CUSTOM_DNN_URL "https://jevois.usc.edu/mc/d"
92
93//! Location of the engine videomappings.cfg definition file
94#define JEVOIS_ENGINE_CONFIG_FILE JEVOIS_CONFIG_PATH "/videomappings.cfg"
95
96//! Location of the engine init script file
97#define JEVOIS_ENGINE_INIT_SCRIPT JEVOIS_CONFIG_PATH "/initscript.cfg"
98
99//! Location of the jevois-pro demo data definition file
100#define JEVOISPRO_DEMO_DATA_FILE JEVOIS_CONFIG_PATH "/demodata.yml"
101
102//! Relative name of optinal default parameters to load for each Module
103#define JEVOIS_MODULE_PARAMS_FILENAME "params.cfg"
104
105//! Relative name of an Engine script to load for each Module
106#define JEVOIS_MODULE_SCRIPT_FILENAME "script.cfg"
107
108//! Disk partition or file that we can export over USB using Engine command 'usbsd'
109#define JEVOIS_USBSD_FILE "/dev/mmcblk0p3"
110
111//! Sysfs location to change the exported partition or file over USB using Engine command 'usbsd"
112#define JEVOIS_USBSD_SYS "/sys/devices/platform/sunxi_usb_udc/gadget/lun0/file"
113
114//! Flag file for whether to enable g_serial at boot on jevoispro
115#define JEVOISPRO_GSERIAL_FILE "/.jevoispro_use_gserial"
116
117//! Installed location of OpenCV compiled for JeVois, needed for Python to find cv2 module:
118#ifdef JEVOIS_PLATFORM_A33
119#define JEVOIS_OPENCV_PREFIX "/usr"
120#define JEVOIS_OPENCV_PYTHON_PATH JEVOIS_OPENCV_PREFIX "/lib/python" JEVOIS_MACRO_STRING(JEVOIS_PYTHON_MAJOR) "." \
121 JEVOIS_MACRO_STRING(JEVOIS_PYTHON_MINOR) "/site-packages"
122#else
123#define JEVOIS_OPENCV_PREFIX "/usr/share/jevois-opencv-4.10.0"
124#define JEVOIS_OPENCV_PYTHON_PATH JEVOIS_OPENCV_PREFIX "/lib/python" JEVOIS_MACRO_STRING(JEVOIS_PYTHON_MAJOR) "." \
125 JEVOIS_MACRO_STRING(JEVOIS_PYTHON_MINOR) "/dist-packages"
126#endif
127
128// Doxygen does not like the macros below, so replace them by no-ops when compiling the documentation:
129#ifdef JEVOIS_DOXYGEN
130#define JEVOIS_UNUSED_PARAM(x) x
131#define JEVOIS_UNUSED_FUNC(x) x
132#else
133
134//! Helper to avoid compiler warnings about unused parameters, we explicitly mark them unused in implementation
135/*! This is from here: http://stackoverflow.com/questions/3599160/unused-parameter-warnings-in-c-code */
136#ifdef __GNUC__
137# define JEVOIS_UNUSED_PARAM(x) JEVOIS_UNUSED_ ## x __attribute__((__unused__))
138#else
139# define JEVOIS_UNUSED_PARAM(x) JEVOIS_UNUSED_ ## x
140#endif
141
142//! Helper to avoid compiler warnings about unused functions, we explicitly marked them unused in implementation
143/*! This is from here: http://stackoverflow.com/questions/3599160/unused-parameter-warnings-in-c-code */
144#ifdef __GNUC__
145# define JEVOIS_UNUSED_FUNC(x) __attribute__((__unused__)) JEVOIS_UNUSED_ ## x
146#else
147# define JEVOIS_UNUSED_FUNC(x) JEVOIS_UNUSED_ ## x
148#endif
149
150//! Prefix used for some CLI commands whose outputs will also get the prefix
151#define JEVOIS_JVINV_PREFIX "JVINV"
152
153#endif