Skip to content

Commit

Permalink
[2.3.2] Import c6f4e8a3c4f
Browse files Browse the repository at this point in the history
  • Loading branch information
nmartin-psee committed Apr 7, 2022
1 parent 92aa7c1 commit 6039499
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 130 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

cmake_minimum_required(VERSION 3.5)

project(metavision VERSION 2.3.1)
project(metavision VERSION 2.3.2)
set(PROJECT_VERSION_SUFFIX "")

if(PROJECT_VERSION_SUFFIX STREQUAL "")
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ To do so, configure the target folder (`OPENEB_INSTALL_DIR`) with `CMAKE_INSTALL
(default value is `C:\Program Files\Prophesee`) when generating the makefiles in step 2:
```bash
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DCMAKE_INSTALL_PREFIX=<OPENEB_INSTALL_DIR> -DBUILD_TESTING=OFF ..
cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DCMAKE_INSTALL_PREFIX=<OPENEB_INSTALL_DIR> -DBUILD_TESTING=OFF
```
You can also configure the directory where the Python packages will be deployed using the `PYTHON3_SITE_PACKAGES` variable
(note that in that case, you will also need to edit your environment variable `PYTHONPATH` and append the `<PYTHON3_PACKAGES_INSTALL_DIR>` path):
```bash
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DCMAKE_INSTALL_PREFIX=<OPENEB_INSTALL_DIR> -DPYTHON3_SITE_PACKAGES=<PYTHON3_PACKAGES_INSTALL_DIR> -DBUILD_TESTING=OFF ..
cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DCMAKE_INSTALL_PREFIX=<OPENEB_INSTALL_DIR> -DPYTHON3_SITE_PACKAGES=<PYTHON3_PACKAGES_INSTALL_DIR> -DBUILD_TESTING=OFF
```
Once you performed this configuration, you can launch the actual installation of the OpenEB files:
Expand Down
4 changes: 2 additions & 2 deletions cmake/custom_functions/add_library_version_header.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
# See the License for the specific language governing permissions and limitations under the License.

set(GIT_BRANCH "main")
set(GIT_COMMIT_ID "a8766f02ffea11e97676a5d4b1709b8555298c6d")
set(GIT_COMMIT_DATE "2022-02-07 18:51:39 +0100")
set(GIT_COMMIT_ID "c6f4e8a3c4fa56f8954b23643c0c60174997930b")
set(GIT_COMMIT_DATE "2022-04-05 18:40:34 +0200")

# If git information are not provided in command line when running cmake, try to automatically determine them
if(NOT GIT_BRANCH OR NOT GIT_COMMIT_ID OR NOT GIT_COMMIT_DATE)
Expand Down
10 changes: 2 additions & 8 deletions cmake/custom_functions/lfs_download.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@ set(GIT_LFS_NOT_AVAILABLE True)
function(lfs_download)
if (${ARGC} GREATER 0)
string(REPLACE ";" ", " file_or_dir_to_download_comma_separated "${ARGN}")
if (GIT_LFS_NOT_AVAILABLE)
foreach(file_or_dir_to_download ${ARGN})
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/${file_or_dir_to_download}")
message("Git LFS is not available, skipping download of ${file_or_dir_to_download}")
endif()
endforeach(file_or_dir_to_download)
else()
if (NOT GIT_LFS_NOT_AVAILABLE)
foreach(file_or_dir_to_download ${ARGN})
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/${file_or_dir_to_download}")
message(FATAL_ERROR "${PROJECT_SOURCE_DIR}/${file_or_dir_to_download} does not exist")
Expand All @@ -39,6 +33,6 @@ function(lfs_download)
if (RESULT AND NOT RESULT EQUAL 0)
message(FATAL_ERROR "lfs_download error : ${ERROR} output : ${OUTPUT}")
endif ()
endif(GIT_LFS_NOT_AVAILABLE)
endif (NOT GIT_LFS_NOT_AVAILABLE)
endif ()
endfunction()
4 changes: 2 additions & 2 deletions cmake/custom_targets/README_metavision_open.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ To do so, configure the target folder (`OPENEB_INSTALL_DIR`) with `CMAKE_INSTALL
(default value is `C:\Program Files\Prophesee`) when generating the makefiles in step 2:
```bash
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DCMAKE_INSTALL_PREFIX=<OPENEB_INSTALL_DIR> -DBUILD_TESTING=OFF ..
cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DCMAKE_INSTALL_PREFIX=<OPENEB_INSTALL_DIR> -DBUILD_TESTING=OFF
```
You can also configure the directory where the Python packages will be deployed using the `PYTHON3_SITE_PACKAGES` variable
(note that in that case, you will also need to edit your environment variable `PYTHONPATH` and append the `<PYTHON3_PACKAGES_INSTALL_DIR>` path):
```bash
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DCMAKE_INSTALL_PREFIX=<OPENEB_INSTALL_DIR> -DPYTHON3_SITE_PACKAGES=<PYTHON3_PACKAGES_INSTALL_DIR> -DBUILD_TESTING=OFF ..
cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DCMAKE_INSTALL_PREFIX=<OPENEB_INSTALL_DIR> -DPYTHON3_SITE_PACKAGES=<PYTHON3_PACKAGES_INSTALL_DIR> -DBUILD_TESTING=OFF
```
Once you performed this configuration, you can launch the actual installation of the OpenEB files:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ void do_systems_diagnosis() {
if (do_usb_port_analysis) {
print_section("SYSTEM'S USB PORTS");

std::vector<std::string> vendor_and_product_ids = {"04b4:00f4", "03fd:5832"};
std::vector<std::string> vendor_and_product_ids = {"04b4:00f4", "04b4:00f5", "03fd:5832"};

bool usb2_found = false;
int nr_usb_port_found = 0;
Expand Down
24 changes: 12 additions & 12 deletions hal/cpp/samples/metavision_hal_viewer/metavision_hal_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,21 @@ int main(int argc, char *argv[]) {
/// [RawfileCreation]

/// [triggers]
// We enable Trigger Out and duplicate the signal on Trigger In using the loopback channel
// On camera providing Trigger Out, we enable it and duplicate the signal on Trigger In using the loopback channel
// On the other cameras, we enable Trigger In, but we will need to plug a signal generator to create trigger events
// and we also set the camera as Master so that we can test the Sync Out signal if needed.
Metavision::I_TriggerOut *i_trigger_out = device->get_facility<Metavision::I_TriggerOut>();
Metavision::I_TriggerIn *i_trigger_in = device->get_facility<Metavision::I_TriggerIn>();
if (i_trigger_in && i_trigger_out) {
i_trigger_out->set_period(100000);
i_trigger_out->set_duty_cycle(0.5);
i_trigger_out->enable();
i_trigger_in->enable(trigger_in_channels[plugin_name].loopback_channel);
}

if (system_id == 0x30 || system_id == 0x31) {
// Evk3 Gen41 system
if (i_trigger_in && i_device_control) {
i_device_control->set_mode_master();
if (i_trigger_in) {
if (i_trigger_out) {
i_trigger_out->set_period(100000);
i_trigger_out->set_duty_cycle(0.5);
i_trigger_out->enable();
i_trigger_in->enable(trigger_in_channels[plugin_name].loopback_channel);
} else if (i_device_control) {
std::cout << "Could not get Trigger Out facility" << std::endl;
i_trigger_in->enable(0);
i_device_control->set_mode_master();
}
}
/// [triggers]
Expand Down
28 changes: 14 additions & 14 deletions hal_openeb_plugins/include/common/raw_evt3_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ struct EventTime {
};

enum class TypesEnum : EventTypesUnderlying_t {
TD_Y = 0x0,
X_POS = 0x2,
X_BASE = 0x3,
EVT_ADDR_Y = 0x0,
EVT_ADDR_X = 0x2,
VECT_BASE_X = 0x3,
VECT_12 = 0x4,
VECT_8 = 0x5,
TIME_LOW = 0x6,
Expand Down Expand Up @@ -169,10 +169,10 @@ class Decoder : public Metavision::I_Decoder {
auto &trigger_forwarder = trigger_event_forwarder();
for (; cur_raw_ev != raw_ev_end;) {
const uint16_t type = cur_raw_ev->type;
if (type == static_cast<EventTypesUnderlying_t>(TypesEnum::X_POS)) {
if (type == static_cast<EventTypesUnderlying_t>(TypesEnum::EVT_ADDR_X)) {
if (is_valid) {
EventPosX *ev_posx = reinterpret_cast<EventPosX *>(cur_raw_ev);
cd_forwarder.forward(static_cast<unsigned short>(ev_posx->x), state[(int)TypesEnum::TD_Y],
cd_forwarder.forward(static_cast<unsigned short>(ev_posx->x), state[(int)TypesEnum::EVT_ADDR_Y],
static_cast<short>(ev_posx->pol), last_timestamp<DO_TIMESHIFT>());
}
++cur_raw_ev;
Expand Down Expand Up @@ -200,29 +200,29 @@ class Decoder : public Metavision::I_Decoder {

uint32_t valid = m.valid;

uint16_t last_x = state[(int)TypesEnum::X_BASE] & NOT_POLARITY_MASK;
uint16_t last_x = state[(int)TypesEnum::VECT_BASE_X] & NOT_POLARITY_MASK;
uint16_t nb_bits = 32;
#if defined(__x86_64__) || defined(__aarch64__)
uint16_t off = 0;
while (valid) {
off = __builtin_ctz(valid);
valid &= ~(1 << off);
cd_forwarder.forward_unsafe(last_x + off, state[(int)TypesEnum::TD_Y],
(bool)(state[(int)TypesEnum::X_BASE] & POLARITY_MASK),
cd_forwarder.forward_unsafe(last_x + off, state[(int)TypesEnum::EVT_ADDR_Y],
(bool)(state[(int)TypesEnum::VECT_BASE_X] & POLARITY_MASK),
last_timestamp<DO_TIMESHIFT>());
}
#else
uint16_t end = last_x + nb_bits;
for (uint16_t i = last_x; i != end; ++i) {
if (valid & 0x1) {
cd_forwarder.forward_unsafe(i, state[(int)TypesEnum::TD_Y],
(bool)(state[(int)TypesEnum::X_BASE] & POLARITY_MASK),
cd_forwarder.forward_unsafe(i, state[(int)TypesEnum::EVT_ADDR_Y],
(bool)(state[(int)TypesEnum::VECT_BASE_X] & POLARITY_MASK),
last_timestamp<DO_TIMESHIFT>());
}
valid >>= 1;
}
#endif
state[(int)TypesEnum::X_BASE] += nb_bits;
state[(int)TypesEnum::VECT_BASE_X] += nb_bits;
cur_raw_ev += vect12_size;

} else if (type == static_cast<EventTypesUnderlying_t>(TypesEnum::TIME_HIGH)) {
Expand All @@ -239,11 +239,11 @@ class Decoder : public Metavision::I_Decoder {
++cur_raw_ev;
} else {
// The objective is to reduce the number of possible cases
// The content of each type is store into a state because the encoding is statefull
// The content of each type is store into a state because the encoding is stateful
state[type] = cur_raw_ev->content;
// Some event outside of the sensor may occur, to limit the number of test the check is done
// every TD_Y
is_valid = state[(int)TypesEnum::TD_Y] < height_;
// every EVT_ADDR_Y
is_valid = state[(int)TypesEnum::EVT_ADDR_Y] < height_;

last_timestamp_.bitfield_time.low = type != static_cast<EventTypesUnderlying_t>(TypesEnum::TIME_LOW) ?
last_timestamp_.bitfield_time.low :
Expand Down
17 changes: 10 additions & 7 deletions sdk/modules/core/cpp/apps/metavision_player/src/camera_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,16 @@ CameraView::~CameraView() {

if (live_) {
// Update values of current biases
auto &cam = camera();
try {
auto *bias = cam.biases().get_facility();
for (auto p : biasLabelToName) {
current_biases[p.first] = bias->get(p.second);
}
} catch (...) {}
auto &cam = camera();
const auto &params = parameters();
if (params.show_biases) {
try {
auto *bias = cam.biases().get_facility();
for (auto p : biasLabelToName) {
current_biases[p.first] = bias->get(p.second);
}
} catch (...) {}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/modules/core/python/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.

lfs_download("datasets/metavision_core/csv_zip_eth")
lfs_download("datasets/openeb/core/event_io/csv_zip_eth")

add_sdk_python_module_test(core)
Loading

0 comments on commit 6039499

Please sign in to comment.