Skip to content

Commit

Permalink
Release 2.25.1 (#1005)
Browse files Browse the repository at this point in the history
* fix finding jsoncpp

* FW: fix fsync for OAK-D-SR

* Change IMU fw update status to int

* Add tilt projection support

* Introduced `DeviceBootloader::getFlashedVersion` to retrieve the bootloader version flashed on the device. Fixed `isUserBootloaderSupported` - thereby fixed user bootloader flashing. (#997)

* Introduced DeviceBootloader::getFlashedVersion to retrieve the bootloader version flashed on the device. Fixed isUserBootloaderSupported - thereby fixed user bootloader flashing.

* Applied the suggestions

* Fix sensor configs for ov9282/ov9782 (differentiate between color/mono when possible)

* FW: fixes for IMX378 and IMX582:
fix concurrent run,
fix scaling with IMX378 THE_1352X1012 resolution,
change Camera node best sensor config select to prioritize matching aspect ratio

* Add jsoncpp with hunter

* Make PCL include optional

* Fixed booting issue on OAK D SR POE and OAK T. (#1002)

* Fail loudly if PCL enabled, README changes

* Conditionally add jsoncpp package

* FW: fix default fsync GPIO state for OAK-FFC-4P R7,
FSIN_4LANE GPIO42 = input, pull-down

* Bumped version to 2.25.1

* Fix FFC3P - not found after booting if ov9282 is connected.

* Make getAllConnectedDevices consistent when no devices are found

---------

Co-authored-by: Serafadam <serafadam@gmail.com>
Co-authored-by: alex-luxonis <alex@luxonis.com>
Co-authored-by: asahtik <asahtik@gmail.com>
Co-authored-by: SzabolcsGergely <szabi@luxonis.com>
Co-authored-by: asahtik <38485424+asahtik@users.noreply.github.com>
Co-authored-by: Matevz Morato <matevz.morato@gmail.com>
Co-authored-by: moratom <47612463+moratom@users.noreply.github.com>
  • Loading branch information
8 people authored Apr 22, 2024
1 parent 4042aec commit c21bdd3
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 17 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if(WIN32)
endif()

# Create depthai project
project(depthai VERSION "2.25.0" LANGUAGES CXX C)
project(depthai VERSION "2.25.1" LANGUAGES CXX C)
get_directory_property(has_parent PARENT_DIRECTORY)
if(has_parent)
set(DEPTHAI_VERSION ${PROJECT_VERSION} PARENT_SCOPE)
Expand Down Expand Up @@ -302,7 +302,7 @@ option(DEPTHAI_BUILD_TESTS "Build tests" OFF)
option(DEPTHAI_BUILD_EXAMPLES "Build examples - Requires OpenCV library to be installed" OFF)
option(DEPTHAI_BUILD_DOCS "Build documentation - requires doxygen to be installed" OFF)
option(DEPTHAI_OPENCV_SUPPORT "Enable optional OpenCV support" ON)
option(DEPTHAI_PCL_SUPPORT "Enable optional PCL support" ON)
option(DEPTHAI_PCL_SUPPORT "Enable optional PCL support" OFF)


option(DEPTHAI_BINARIES_RESOURCE_COMPILE "Compile Depthai device side binaries into library" ON)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ The following environment variables can be set to alter default behavior of the
| DEPTHAI_LIBUSB_ANDROID_JAVAVM | JavaVM pointer that is passed to libusb for rootless Android interaction with devices. Interpreted as decimal value of uintptr_t |
| DEPTHAI_CRASHDUMP | Directory in which to save the crash dump. |
| DEPTHAI_CRASHDUMP_TIMEOUT | Specifies the duration in seconds to wait for device reboot when obtaining a crash dump. Crash dump retrieval disabled if 0. |
| DEPTHAI_PCL_SUPPORT | Enables PCL support. |

## Running tests

Expand Down
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiBootloaderConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ set(DEPTHAI_BOOTLOADER_MATURITY "release")
# set(DEPTHAI_BOOTLOADER_MATURITY "snapshot")

# "version if applicable"
set(DEPTHAI_BOOTLOADER_VERSION "0.0.26")
set(DEPTHAI_BOOTLOADER_VERSION "0.0.27")
# set(DEPTHAI_BOOTLOADER_VERSION "0.0.24+57c26493754e2f00e57f6594b0b1a317f762d5f2")
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceSideConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "7665aed8712bb941958660a0103868908726eb56")
set(DEPTHAI_DEVICE_SIDE_COMMIT "c7127782f2da45aac89d5b5b816d04cc45ae40be")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
12 changes: 9 additions & 3 deletions cmake/depthaiDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ else()
hunter_add_package(Backward)
endif()
hunter_add_package(libnop)
if(DEPTHAI_PCL_SUPPORT)
hunter_add_package(jsoncpp)
endif()
endif()

# If library was build as static, find all dependencies
Expand Down Expand Up @@ -76,13 +79,16 @@ endif()

# OpenCV 4 - (optional, quiet always)
find_package(OpenCV 4 QUIET CONFIG)

find_package(jsoncpp QUIET)
if(DEPTHAI_PCL_SUPPORT AND NOT TARGET JsonCpp::JsonCpp)
find_package(jsoncpp)
endif()
set(MODULE_TEMP ${CMAKE_MODULE_PATH})
set(PREFIX_TEMP ${CMAKE_PREFIX_PATH})
set(CMAKE_MODULE_PATH ${_DEPTHAI_MODULE_PATH_ORIGINAL})
set(CMAKE_PREFIX_PATH ${_DEPTHAI_PREFIX_PATH_ORIGINAL})
find_package(PCL QUIET CONFIG COMPONENTS common visualization)
if(DEPTHAI_PCL_SUPPORT)
find_package(PCL CONFIG COMPONENTS common visualization)
endif()
set(CMAKE_MODULE_PATH ${MODULE_TEMP})
set(CMAKE_PREFIX_PATH ${PREFIX_TEMP})

Expand Down
2 changes: 1 addition & 1 deletion examples/IMU/imu_firmware_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int main() {

while(true) {
bool fwUpdateFinished;
float percentage;
unsigned int percentage;
std::tie(fwUpdateFinished, percentage) = device.getIMUFirmwareUpdateStatus();
std::cout << "IMU FW update status: " << std::setprecision(1) << percentage << std::endl;
if(fwUpdateFinished) {
Expand Down
2 changes: 1 addition & 1 deletion include/depthai/device/DeviceBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ class DeviceBase {
* return value true and 100 means that the update was successful
* return value true and other than 100 means that the update failed
*/
std::tuple<bool, float> getIMUFirmwareUpdateStatus();
std::tuple<bool, unsigned int> getIMUFirmwareUpdateStatus();

/**
* Retrieves current DDR memory information from device
Expand Down
9 changes: 8 additions & 1 deletion include/depthai/device/DeviceBootloader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,12 @@ class DeviceBootloader {
*/
Version getVersion() const;

/**
* @return Version of the bootloader that is flashed on the device.
* Nullopt when the version could not be retrieved because the device was in X_LINK_UNBOOTED state before booting the bootloader.
*/
tl::optional<Version> getFlashedVersion() const;

/**
* @returns True when bootloader was booted using latest bootloader integrated in the library.
* False when bootloader is already running on the device and just connected to.
Expand Down Expand Up @@ -504,6 +510,7 @@ class DeviceBootloader {

bool isEmbedded = false;
Type bootloaderType;
tl::optional<Version> flashedVersion;

// closed
std::atomic<bool> closed{false};
Expand Down Expand Up @@ -586,4 +593,4 @@ inline std::ostream& operator<<(std::ostream& out, const dai::DeviceBootloader::

inline std::ostream& operator<<(std::ostream& out, const dai::DeviceBootloader::Version& v) {
return out << v.toString();
}
}
4 changes: 2 additions & 2 deletions src/device/DeviceBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1158,8 +1158,8 @@ bool DeviceBase::startIMUFirmwareUpdate(bool forceUpdate) {
return pimpl->rpcClient->call("startIMUFirmwareUpdate", forceUpdate).as<bool>();
}

std::tuple<bool, float> DeviceBase::getIMUFirmwareUpdateStatus() {
return pimpl->rpcClient->call("getIMUFirmwareUpdateStatus").as<std::tuple<bool, float>>();
std::tuple<bool, unsigned int> DeviceBase::getIMUFirmwareUpdateStatus() {
return pimpl->rpcClient->call("getIMUFirmwareUpdateStatus").as<std::tuple<bool, unsigned int>>();
}

// Convenience functions for querying current system information
Expand Down
26 changes: 22 additions & 4 deletions src/device/DeviceBootloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ void DeviceBootloader::init(bool embeddedMvcmd, const dai::Path& pathToMvcmd, tl

// Retrieve bootloader version
version = requestVersion();
flashedVersion = version;
if(version >= Version(0, 0, 12)) {
// If version is adequate, do an in memory boot.

Expand Down Expand Up @@ -586,6 +587,10 @@ DeviceBootloader::Version DeviceBootloader::getVersion() const {
return version;
}

tl::optional<DeviceBootloader::Version> DeviceBootloader::getFlashedVersion() const {
return flashedVersion;
}

DeviceBootloader::Version DeviceBootloader::requestVersion() {
// Send request to retrieve bootloader version
if(!sendRequest(Request::GetBootloaderVersion{})) {
Expand Down Expand Up @@ -696,8 +701,12 @@ bool DeviceBootloader::isUserBootloaderSupported() {
return false;
}

if(!getFlashedVersion()) {
return false;
}

// Check if bootloader version is adequate
if(getVersion().getSemver() < Version(Request::IsUserBootloader::VERSION)) {
if(getFlashedVersion().value().getSemver() < Version(Request::IsUserBootloader::VERSION)) {
return false;
}

Expand Down Expand Up @@ -725,7 +734,10 @@ std::tuple<bool, std::string> DeviceBootloader::flashDepthaiApplicationPackage(s
std::vector<uint8_t> package,
Memory memory) {
// Bug in NETWORK bootloader in version 0.0.12 < 0.0.14 - flashing can cause a soft brick
auto bootloaderVersion = getVersion();
if(!getFlashedVersion()) {
return {false, "Can't flash DepthAI application package without knowing flashed bootloader version."};
}
auto bootloaderVersion = *getFlashedVersion();
if(bootloaderType == Type::NETWORK && bootloaderVersion < Version(0, 0, 14)) {
throw std::invalid_argument("Network bootloader requires version 0.0.14 or higher to flash applications. Current version: "
+ bootloaderVersion.toString());
Expand Down Expand Up @@ -925,8 +937,14 @@ std::tuple<bool, std::string> DeviceBootloader::flashUserBootloader(std::functio
// }

// Check if bootloader version is adequate
if(getVersion().getSemver() < Version(Request::IsUserBootloader::VERSION)) {
throw std::runtime_error("Current bootloader version doesn't support User Bootloader");
if(!getFlashedVersion()) {
throw std::runtime_error(
"Couldn't retrieve version of the flashed bootloader. Make sure you have a factory bootloader flashed and the device is booted to bootloader.");
}
if(getFlashedVersion().value().getSemver() < Version(Request::IsUserBootloader::VERSION)) {
throw std::runtime_error(fmt::format("Current bootloader version doesn't support User Bootloader. Current version: {}, minimum required version: {}",
getFlashedVersion().value().toStringSemver(),
Version(Request::IsUserBootloader::VERSION).toStringSemver()));
}

// Retrieve bootloader
Expand Down
2 changes: 1 addition & 1 deletion src/xlink/XLinkConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ std::vector<DeviceInfo> XLinkConnection::getAllConnectedDevices(XLinkDeviceState
auto allowedDeviceNames = utility::getEnv("DEPTHAI_DEVICE_NAME_LIST");

auto status = XLinkFindAllSuitableDevices(suitableDevice, deviceDescAll.data(), static_cast<unsigned int>(deviceDescAll.size()), &numdev);
if(status != X_LINK_SUCCESS) throw std::runtime_error("Couldn't retrieve all connected devices");
if(status != X_LINK_SUCCESS && status != X_LINK_DEVICE_NOT_FOUND) throw std::runtime_error("Couldn't retrieve all connected devices");

for(unsigned i = 0; i < numdev; i++) {
DeviceInfo info(deviceDescAll.at(i));
Expand Down

0 comments on commit c21bdd3

Please sign in to comment.