Skip to content

Commit

Permalink
Release v4.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jthierry-psee committed Jun 17, 2024
1 parent 5f7f47a commit e446586
Show file tree
Hide file tree
Showing 32 changed files with 971 additions and 143 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif(NOT CMAKE_BUILD_TYPE)

cmake_minimum_required(VERSION 3.5)

project(metavision VERSION 4.6.0)
project(metavision VERSION 4.6.1)
set(PROJECT_VERSION_SUFFIX "")

if(PROJECT_VERSION_SUFFIX STREQUAL "")
Expand All @@ -26,6 +26,8 @@ else(PROJECT_VERSION_SUFFIX STREQUAL "")
set(PROJECT_VERSION_FULL "${PROJECT_VERSION}-${PROJECT_VERSION_SUFFIX}")
endif(PROJECT_VERSION_SUFFIX STREQUAL "")

include(CTest)

# Set output directory for build targets
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/ CACHE PATH "Output directory of libraries.")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/ CACHE PATH "Output directory of all executables.")
Expand Down Expand Up @@ -227,7 +229,6 @@ if (GENERATE_DOC)
endif (GENERATE_DOC)

# Tests
include(CTest)
if (BUILD_TESTING)
# Gtest
find_package(GTest CONFIG)
Expand Down Expand Up @@ -456,6 +457,9 @@ add_subdirectory(utils/scripts)
# Add open archive task after modules, hal and plugins that might affect it
include(create_metavision_open_archive)

# Create metavision-get-started archive
include(create_metavision_get_started_archive)

################################################### CPack for debian packages

include(deb_packages)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ python3 -m pip install "numba==0.56.3" "profilehooks==1.12.0" "pytorch_lightning

### Compilation

1. Retrieve the code: `git clone https://github.com/prophesee-ai/openeb.git --branch 4.6.0`.
1. Retrieve the code: `git clone https://github.com/prophesee-ai/openeb.git --branch 4.6.1`.
(If you choose to download an archive of OpenEB from GitHub rather than cloning the repository,
you need to ensure that you select a ``Full.Source.Code.*`` archive instead of using
the automatically generated ``Source.Code.*`` archives. This is because the latter do not include
Expand Down Expand Up @@ -324,7 +324,7 @@ python -m pip install "numba==0.56.3" "profilehooks==1.12.0" "pytorch_lightning=
First, retrieve the codebase:
```bash
git clone https://github.com/prophesee-ai/openeb.git --branch 4.6.0
git clone https://github.com/prophesee-ai/openeb.git --branch 4.6.1
```
Note that if you choose to download an archive of OpenEB from GitHub rather than cloning the repository,
Expand Down Expand Up @@ -356,7 +356,7 @@ or you can deploy the OpenEB files (applications, samples, libraries etc.) in a
* Option 2 - deploying in a directory of your choice
* To deploy SDK Pro in the default folder (`C:\Program Files\Prophesee`), execute this command
* To deploy OpenEB in the default folder (`C:\Program Files\Prophesee`), execute this command
(your console should be launched as an administrator):
```bash
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 "95ccd2597aa7a8f8f44fd6ee405c4f3a8f9eda24")
set(GIT_COMMIT_DATE "2024-05-21 15:27:14 +0200")
set(GIT_COMMIT_ID "4bade2b1aeb57e36ba22a68e4270470d9d4d8715")
set(GIT_COMMIT_DATE "2024-06-14 10:34:56 +0000")

find_program(GIT_SCM git DOC "Git version control" HINTS "C:\\Program Files\\Git\\bin\\")

Expand Down
6 changes: 3 additions & 3 deletions cmake/custom_targets/README_metavision_open.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ python3 -m pip install "numba==0.56.3" "profilehooks==1.12.0" "pytorch_lightning

### Compilation

1. Retrieve the code: `git clone https://github.com/prophesee-ai/openeb.git --branch 4.6.0`.
1. Retrieve the code: `git clone https://github.com/prophesee-ai/openeb.git --branch 4.6.1`.
(If you choose to download an archive of OpenEB from GitHub rather than cloning the repository,
you need to ensure that you select a ``Full.Source.Code.*`` archive instead of using
the automatically generated ``Source.Code.*`` archives. This is because the latter do not include
Expand Down Expand Up @@ -324,7 +324,7 @@ python -m pip install "numba==0.56.3" "profilehooks==1.12.0" "pytorch_lightning=
First, retrieve the codebase:
```bash
git clone https://github.com/prophesee-ai/openeb.git --branch 4.6.0
git clone https://github.com/prophesee-ai/openeb.git --branch 4.6.1
```
Note that if you choose to download an archive of OpenEB from GitHub rather than cloning the repository,
Expand Down Expand Up @@ -356,7 +356,7 @@ or you can deploy the OpenEB files (applications, samples, libraries etc.) in a
* Option 2 - deploying in a directory of your choice
* To deploy SDK Pro in the default folder (`C:\Program Files\Prophesee`), execute this command
* To deploy OpenEB in the default folder (`C:\Program Files\Prophesee`), execute this command
(your console should be launched as an administrator):
```bash
Expand Down
27 changes: 27 additions & 0 deletions cmake/custom_targets/create_metavision_get_started_archive.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (c) Prophesee S.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
# 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.

set(output_metavision_get_started_archive_dir_path "${GENERATE_FILES_DIRECTORY}/metavision_get_started_archive")

add_custom_target(create_metavision_get_started_archive_folder
COMMAND ${CMAKE_COMMAND}
-DPROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}"
-DOUTPUT_DIR="${output_metavision_get_started_archive_dir_path}"
-DCMAKE_MODULE_PATH="${CMAKE_MODULE_PATH}"
-DGENERATE_FILES_DIRECTORY="${GENERATE_FILES_DIRECTORY}"
-P ${CMAKE_CURRENT_LIST_DIR}/create_metavision_get_started_archive_folder.cmake
)

set(output_metavision_get_started_archive_path "${GENERATE_FILES_DIRECTORY}/metavision_get_started_${PROJECT_VERSION_FULL}.tar")

add_custom_target(create_metavision_get_started_archive
COMMAND ${CMAKE_COMMAND} -E chdir ${output_metavision_get_started_archive_dir_path} ${CMAKE_COMMAND} -E tar cvf ${output_metavision_get_started_archive_path} .
COMMAND ${CMAKE_COMMAND} -E echo "File ${output_metavision_get_started_archive_path} generated"
)
add_dependencies(create_metavision_get_started_archive create_metavision_get_started_archive_folder)
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Copyright (c) Prophesee S.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
# 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.

# Create directory where we will add the files needed to compile the open source offer
file(REMOVE_RECURSE "${OUTPUT_DIR}")
file(MAKE_DIRECTORY "${OUTPUT_DIR}")

# For some reason, CMAKE_MODULE_PATH passed by create_metavision_open_archive
# has spaces instead of semicolumns
string(REPLACE " " ";" CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}")

include(overridden_cmake_functions)

set(MV_GET_STARTED_FILES images README.md)
list_transform_prepend (MV_GET_STARTED_FILES metavision-get-started/)

# Add the files and folders needed to compile open :
foreach (file_or_dir ${MV_GET_STARTED_FILES})
if (EXISTS "${PROJECT_SOURCE_DIR}/${file_or_dir}")
get_filename_component(dest "${OUTPUT_DIR}/${file_or_dir}" DIRECTORY)
file(COPY "${PROJECT_SOURCE_DIR}/${file_or_dir}"
DESTINATION "${dest}"
PATTERN __pycache__ EXCLUDE
)
endif ()
endforeach(file_or_dir)

set(METAVISION_GET_STARTED_FOLDER "${OUTPUT_DIR}/metavision-get-started/")

function(copy_cpp_sample path)
set(sample_path ${PROJECT_SOURCE_DIR}/${path})
if (EXISTS ${sample_path})
get_filename_component(dest_folder_name ${sample_path} NAME)
set(dest_path "${METAVISION_GET_STARTED_FOLDER}")
file(COPY "${sample_path}"
DESTINATION "${dest_path}"
)
set(cmakelist_file ${dest_path}${dest_folder_name}/CMakeLists.txt)
file (REMOVE ${cmakelist_file})
file (RENAME ${cmakelist_file}.install ${cmakelist_file})
else()
message(FATAL_ERROR "The requested sample does not exist: ${sample_path}")
endif ()
endfunction()

function(copy_python_sample path)
set(sample_path ${PROJECT_SOURCE_DIR}/${path})
if (EXISTS ${sample_path})
get_filename_component(dest_folder_name "${sample_path}" NAME)
set(dest_path "${METAVISION_GET_STARTED_FOLDER}")
file(COPY "${sample_path}"
DESTINATION "${dest_path}"
PATTERN __pycache__ EXCLUDE
)
file (REMOVE ${dest_path}${dest_folder_name}/CMakeLists.txt)
else()
message(FATAL_ERROR "The requested sample does not exist: ${sample_path}")
endif ()
endfunction()

# Add some Metavision Python samples to the metavision-get-started folder
copy_python_sample("sdk/modules/core/python/samples/metavision_time_surface")
copy_python_sample("sdk/modules/ml/python_extended/samples/flow_inference")

# Add some Metavision C++ samples to the metavision-get-started folder
copy_cpp_sample("sdk/modules/core/cpp/samples/metavision_time_surface")
copy_cpp_sample("sdk/modules/core/cpp/samples/metavision_dummy_radar")

# Copy license files
set(LICENSE_FILES "licensing/LICENSE_METAVISION_SDK" "licensing/LICENSE_OPEN")
foreach (file ${LICENSE_FILES})
file(COPY "${PROJECT_SOURCE_DIR}/${file}"
DESTINATION "${METAVISION_GET_STARTED_FOLDER}/licensing"
)
endforeach(file)

8 changes: 4 additions & 4 deletions hal/cpp/src/device/device_discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void common_log_plugin_error(const Metavision::Plugin &plugin, const std::string
}

void log_plugin_error(const Metavision::Plugin &plugin, const std::string &discovery_name,
const Metavision::HalException &e) {
const Metavision::BaseException &e) {
common_log_plugin_error(plugin, discovery_name);
MV_HAL_LOG_ERROR() << "Failed with exception:";
MV_HAL_LOG_ERROR() << e.what();
Expand Down Expand Up @@ -408,7 +408,7 @@ std::unique_ptr<Device> DeviceDiscovery::open(const std::string &input_serial, c
log_plugin_error(plugin, camera_discovery.get_name(), e);
} catch (const HalConnectionException &e) {
log_plugin_error(plugin, camera_discovery.get_name(), e);
throw e;
throw;
} catch (const std::exception &e) {
log_plugin_error(plugin, camera_discovery.get_name(), e);
} catch (...) { log_plugin_error(plugin, camera_discovery.get_name()); }
Expand Down Expand Up @@ -461,7 +461,7 @@ std::unique_ptr<Device> DeviceDiscovery::open_raw_file(const std::string &raw_fi

} catch (const HalException &e) {
MV_HAL_LOG_ERROR() << Log::no_space << "While opening RAW file '" << raw_file << "':" << std::endl;
throw e;
throw;
}

return device;
Expand Down Expand Up @@ -567,7 +567,7 @@ std::unique_ptr<Device> DeviceDiscovery::open_stream(std::unique_ptr<std::istrea
log_plugin_error(plugin, file_discovery.get_name(), e);
} catch (const HalConnectionException &e) {
log_plugin_error(plugin, file_discovery.get_name(), e);
throw e;
throw;
} catch (const std::exception &e) {
log_plugin_error(plugin, file_discovery.get_name(), e);
} catch (...) { log_plugin_error(plugin, file_discovery.get_name()); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ class TzCameraDiscovery : public Metavision::CameraDiscovery {
public:
TzCameraDiscovery();

struct DeviceBuilderParameters : public Metavision::DeviceBuilderParameters {
DeviceBuilderParameters(std::shared_ptr<LibUSBContext> libusb_ctx,
const std::shared_ptr<BoardCommand> &board_cmd) :
board_cmd(board_cmd), libusb_ctx(libusb_ctx) {}
std::shared_ptr<BoardCommand> board_cmd;
std::shared_ptr<LibUSBContext> libusb_ctx;
};

virtual CameraDiscovery::SerialList list() override;
virtual CameraDiscovery::SystemList list_available_sources() override;
virtual bool discover(Metavision::DeviceBuilder &device_builder, const std::string &serial,
Expand All @@ -49,7 +41,6 @@ class TzCameraDiscovery : public Metavision::CameraDiscovery {

private:
std::vector<std::shared_ptr<BoardCommand>> list_boards() const;
std::shared_ptr<LibUSBContext> libusb_ctx;
std::unique_ptr<TzDeviceBuilder> builder;

// By default, nothing is supported, because we want boards to be ignored by the plugins that can manage it, so that
Expand Down
6 changes: 3 additions & 3 deletions hal_psee_plugins/include/boards/v4l2/v4l2_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
#ifndef METAVISION_HAL_PSEE_PLUGINS_V4L2_DEVICE_H
#define METAVISION_HAL_PSEE_PLUGINS_V4L2_DEVICE_H

#include <algorithm>
#include <cstddef>
#include <iterator>
#include <string>
#include <vector>

#include <linux/videodev2.h>

#include "metavision/hal/facilities/i_hw_identification.h"
#include "metavision/hal/facilities/i_camera_synchronization.h"
#include "metavision/hal/utils/camera_discovery.h"
#include "metavision/hal/utils/device_control.h"

namespace Metavision {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ class LibUSBDevice {
void interrupt_transfer(unsigned char endpoint, unsigned char *data, int length, int *transferred,
unsigned int timeout);

void force_release();

friend void libusb_fill_control_transfer(struct libusb_transfer *transfer, std::shared_ptr<LibUSBDevice> dev,
unsigned char *buffer, libusb_transfer_cb_fn callback, void *user_data,
unsigned int timeout) {
Expand Down
7 changes: 4 additions & 3 deletions hal_psee_plugins/src/boards/treuzell/tz_camera_discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@

namespace Metavision {

TzCameraDiscovery::TzCameraDiscovery() :
libusb_ctx(std::make_shared<LibUSBContext>()), builder(std::make_unique<TzDeviceBuilder>()) {}
TzCameraDiscovery::TzCameraDiscovery() : builder(std::make_unique<TzDeviceBuilder>()) {}

std::vector<std::shared_ptr<BoardCommand>> TzCameraDiscovery::list_boards() const {
std::vector<std::shared_ptr<BoardCommand>>
TzCameraDiscovery::list_boards() const {
std::shared_ptr<LibUSBContext> libusb_ctx = std::make_shared<LibUSBContext>();
std::vector<std::shared_ptr<BoardCommand>> boards;
libusb_device **devs;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ std::string TzLibUSBBoardCommand::get_serial() {
if (e.code().value() == TZ_TOO_SHORT)
ostr << req.get32(0);
else
throw e;
throw;
}
ostr << std::dec;
return ostr.str();
Expand Down Expand Up @@ -273,7 +273,7 @@ unsigned int TzLibUSBBoardCommand::get_device_count() {
} catch (std::system_error &e) {
if (!quirks.ignore_size_on_device_prop_answer || (e.code().value() != TZ_SIZE_MISMATCH)) {
// if quirk is enabled and error is SIZE_MISMATCH, ignore it
throw e;
throw;
}
}
return req.get32(0);
Expand All @@ -294,7 +294,7 @@ std::vector<uint32_t> TzLibUSBBoardCommand::read_device_register(uint32_t device
int err = req.get32(2);
throw std::system_error(err, std::generic_category());
} else {
throw e;
throw;
}
}
if (req.get32(0) != device)
Expand Down Expand Up @@ -333,7 +333,7 @@ void TzLibUSBBoardCommand::write_device_register(uint32_t device, uint32_t addre
int err = req.get32(2);
throw std::system_error(err, std::generic_category());
} else {
throw e;
throw;
}
}
if (req.get32(0) != device)
Expand Down
Loading

0 comments on commit e446586

Please sign in to comment.