From 9816fd1b1b8fa6aead5c0c3fce0f994743c39808 Mon Sep 17 00:00:00 2001 From: mgjerde Date: Thu, 21 Nov 2024 15:10:12 +0100 Subject: [PATCH 1/4] Added more log lines and fixed segfault form thread --- src/CRLCamera/CameraConnection.cpp | 150 +++++++++++++---------------- 1 file changed, 67 insertions(+), 83 deletions(-) diff --git a/src/CRLCamera/CameraConnection.cpp b/src/CRLCamera/CameraConnection.cpp index 19b26644..f5eb4516 100644 --- a/src/CRLCamera/CameraConnection.cpp +++ b/src/CRLCamera/CameraConnection.cpp @@ -53,7 +53,6 @@ namespace VkRender::MultiSense { void CameraConnection::updateActiveDevice(VkRender::Device *dev) { - activeDeviceCameraStreams(dev); auto *p = &dev->parameters; @@ -113,7 +112,8 @@ namespace VkRender::MultiSense { Log::Logger::getInstance()->trace("Pushing {} to threadpool", "setAdditionalParametersTask"); pool->Push(CameraConnection::setAdditionalParametersTask, this, p->stereo.fps, p->stereo.gain, p->stereo.gamma, - p->stereo.stereoPostFilterStrength, p->stereo.hdrEnabled, p->stereo.mtu, dev, dev->configRemoteHead); + p->stereo.stereoPostFilterStrength, p->stereo.hdrEnabled, p->stereo.mtu, dev, + dev->configRemoteHead); } if (dev->parameters.stereo.ep.update && pool->getTaskListSize() < MAX_TASK_STACK_SIZE) { @@ -191,25 +191,23 @@ namespace VkRender::MultiSense { } // Query for status - queryDevice(CameraConnection::getStatusTask, dev, &queryStatusTimer, INTERVAL_1_SECOND); + queryDevice(CameraConnection::getStatusTask, dev, &queryStatusTimer, INTERVAL_1_SECOND); // Query for camera configs if (!dev->updateDeviceConfigsSucceeded) queryDevice(CameraConnection::getCameraConfigsTask, dev, &queryDeviceConfigTimer, INTERVAL_5_SECONDS); - // Read exposure setting around once a second if auto exposure is enabled Also put it into GUI structure auto time = std::chrono::steady_clock::now(); auto elapsedTime = - std::chrono::duration_cast>(time - queryExposureTimer); + std::chrono::duration_cast >(time - queryExposureTimer); if (dev->parameters.stereo.ep.autoExposure && elapsedTime.count() > INTERVAL_1_SECOND && pool->getTaskListSize() < MAX_TASK_STACK_SIZE) { queryExposureTimer = std::chrono::steady_clock::now(); // We also want to make sure that we can query all the device info. Otherwise pinging the camera for updates especially auxImageConfig may not results in any usefull information Log::Logger::getInstance()->trace("Pushing {} to threadpool", "getExposureTask"); pool->Push(CameraConnection::getExposureTask, this, dev, dev->configRemoteHead); - } Log::Logger::getLogMetrics()->device.dev = dev; @@ -218,24 +216,28 @@ namespace VkRender::MultiSense { // Existing queryDevice function void CameraConnection::queryDevice( - std::function taskFunction, - VkRender::Device *dev, - std::chrono::time_point> *queryTimer, - float updateFreqSec) { + std::function taskFunction, + VkRender::Device *dev, + std::chrono::time_point > *queryTimer, + float updateFreqSec) { for (auto &ch: dev->channelInfo) { if (ch.state != CRL_STATE_ACTIVE) continue; auto time = std::chrono::steady_clock::now(); auto timeSpan = - std::chrono::duration_cast>(time - *queryTimer); + std::chrono::duration_cast >(time - *queryTimer); if (pool->getTaskListSize() < MAX_TASK_STACK_SIZE && timeSpan.count() > updateFreqSec) { *queryTimer = std::chrono::steady_clock::now(); Log::Logger::getInstance()->trace("Pushing {} to threadpool", - (updateFreqSec == INTERVAL_1_SECOND ? "getStatusTask" - : "getCameraConfigsTask")); - pool->Push(taskFunction, this, dev->isRemoteHead ? crl::multisense::Remote_Head_VPB : static_cast(0), dev); + (updateFreqSec == INTERVAL_1_SECOND + ? "getStatusTask" + : "getCameraConfigsTask")); + pool->Push(taskFunction, this, + dev->isRemoteHead + ? crl::multisense::Remote_Head_VPB + : static_cast(0), dev); } } } @@ -243,7 +245,6 @@ namespace VkRender::MultiSense { void CameraConnection::activeDeviceCameraStreams(VkRender::Device *dev) { // If we are in 3D mode automatically enable disparity and color streams. if (dev->selectedPreviewTab == CRL_TAB_3D_POINT_CLOUD) { - if (dev->enableIMU) { if (!Utils::isInVector(dev->channelInfo[0].requestedStreams, "IMU")) dev->channelInfo[0].requestedStreams.emplace_back("IMU"); @@ -275,7 +276,6 @@ namespace VkRender::MultiSense { if (!inUse) { Utils::removeFromVector(&chInfo.requestedStreams, "Luma Rectified Left"); } - } else { if (!Utils::isInVector(chInfo.requestedStreams, "Luma Rectified Left")) { chInfo.requestedStreams.emplace_back("Luma Rectified Left"); @@ -303,7 +303,6 @@ namespace VkRender::MultiSense { } else if (auxLumaActive && !auxColorActive) { Utils::removeFromVector(&cInfo.requestedStreams, colorRectified); } - } } else { // Remember to stop streams if we exit 3D view and our color streams are not in use @@ -330,8 +329,6 @@ namespace VkRender::MultiSense { } Utils::removeFromVector(&dev->channelInfo[0].requestedStreams, "IMU"); - - } } @@ -379,10 +376,9 @@ namespace VkRender::MultiSense { // Normalize disparity values if it is running if (shouldNormalize && dev.selectedPreviewTab == CRL_TAB_2D_PREVIEW && Utils::isStreamRunning(dev, "Disparity Left")) { - auto time = std::chrono::steady_clock::now(); auto timeSpan = - std::chrono::duration_cast>(time - calcDisparityNormValuesTimer); + std::chrono::duration_cast >(time - calcDisparityNormValuesTimer); // Check if previous future is finished if (disparityNormFuture.valid() && @@ -406,11 +402,8 @@ namespace VkRender::MultiSense { "Pushing new disparity normalizer calculation to pool"); disparityNormFuture = pool->Push(CameraConnection::findUpperAndLowerDisparityBounds, this, &dev); calcDisparityNormValuesTimer = std::chrono::steady_clock::now(); - } } - - } void @@ -419,7 +412,6 @@ namespace VkRender::MultiSense { return; for (auto &dev: devices) { - if (dev.state == CRL_STATE_INTERRUPT_CONNECTION) { Log::Logger::getInstance()->info("Profile {} set to CRL_STATE_INTERRUPT_CONNECTION", dev.name); dev.record.frame = false; @@ -433,8 +425,8 @@ namespace VkRender::MultiSense { if (dev.state == CRL_STATE_RESET || dev.state == CRL_STATE_DISCONNECT_AND_FORGET || dev.state == CRL_STATE_LOST_CONNECTION) { Log::Logger::getInstance()->info( - "Profile {} set to CRL_STATE_RESET | CRL_STATE_LOST_CONNECTION | CRL_STATE_DISCONNECT_AND_FORGET", - dev.name); + "Profile {} set to CRL_STATE_RESET | CRL_STATE_LOST_CONNECTION | CRL_STATE_DISCONNECT_AND_FORGET", + dev.name); dev.selectedPreviewTab = CRL_TAB_2D_PREVIEW; // Note: Weird place to reset a UI element dev.record.frame = false; saveProfileAndDisconnect(&dev); @@ -471,8 +463,8 @@ namespace VkRender::MultiSense { auto startTime = std::chrono::steady_clock::now(); pool = std::make_unique(3); std::chrono::duration timeSpan = - std::chrono::duration_cast>( - std::chrono::steady_clock::now() - startTime); + std::chrono::duration_cast >( + std::chrono::steady_clock::now() - startTime); Log::Logger::getInstance()->trace("Creating cameraconnection threadpool took {}ms", timeSpan.count() * 1000); // Perform connection by pushing a connect task. @@ -515,7 +507,6 @@ namespace VkRender::MultiSense { dev.name); dev.state = CRL_STATE_LOST_CONNECTION; Log::Logger::getInstance()->info("Set dev {}'s state to CRL_STATE_LOST_CONNECTION ", dev.name); - } } } @@ -565,7 +556,6 @@ namespace VkRender::MultiSense { info.hardwareMagic = cInfo.sensorHardwareMagic; info.hardwareVersion = cInfo.sensorHardwareVersion; info.sensorFpgaDna = cInfo.sensorFpgaDna; - } void CameraConnection::getProfileFromIni(VkRender::Device &dev) const { @@ -575,7 +565,8 @@ namespace VkRender::MultiSense { auto filePath = (Utils::getSystemCachePath() / "crl.ini"); SI_Error rc = ini.LoadFile(filePath.c_str()); - if (rc < 0) {} // Handle error + if (rc < 0) { + } // Handle error else { // A serial number is the section identifier of a profile. I can have three following states // - Not Exist @@ -584,37 +575,31 @@ namespace VkRender::MultiSense { if (ini.SectionExists(cameraSerialNumber.c_str())) { std::string profileName = ini.GetValue(cameraSerialNumber.c_str(), "ProfileName", "default"); std::string mode = ini.GetValue(cameraSerialNumber.c_str(), - ("Mode" + std::to_string(ch)).c_str(), "default"); - std::string layout = ini.GetValue(cameraSerialNumber.c_str(), "Layout", "default"); - std::string enabledSources = ini.GetValue(cameraSerialNumber.c_str(), "EnabledSources", - "default"); - std::string previewOne = ini.GetValue(cameraSerialNumber.c_str(), "Preview1", "Idle"); - std::string previewTwo = ini.GetValue(cameraSerialNumber.c_str(), "Preview2", "Idle"); + ("Mode" + std::to_string(ch)).c_str(), "1"); + std::string layout = ini.GetValue(cameraSerialNumber.c_str(), "Layout", "1"); + Log::Logger::getInstance()->info("Using Layout {} and camera resolution {}", layout, mode); dev.layout = static_cast(std::stoi(layout)); - dev.channelInfo.at(ch).selectedResolutionMode = static_cast(std::stoi( - mode)); + dev.channelInfo.at(ch).selectedResolutionMode = static_cast(std::stoi(mode)); dev.channelInfo.at(ch).selectedModeIndex = std::stoi(mode); // Create previews for (int i = 0; i <= CRL_PREVIEW_FOUR; ++i) { std::string key = "Preview" + std::to_string(i + 1); std::string source = std::string(ini.GetValue(cameraSerialNumber.c_str(), key.c_str(), "")); - std::string remoteHeadIndex = source.substr(source.find_last_of(':') + 1, source.length()); - if (!source.empty() && source != "Source:" + remoteHeadIndex) { + if (!source.empty()) { dev.win[static_cast(i)].selectedSource = source.substr(0, - source.find_last_of( - ':')); - dev.win[static_cast(i)].selectedRemoteHeadIndex = static_cast( std::stoi( - remoteHeadIndex)); + source.find_last_of( + ':')); + dev.win[static_cast(i)].selectedRemoteHeadIndex = static_cast< + crl::multisense::RemoteHeadChannel>(0); Log::Logger::getInstance()->info( - ".ini file: found source '{}' for preview {} at head {}, Adding to requested source", - source.substr(0, source.find_last_of(':')), - i + 1, ch); + ".ini file: found source '{}' for preview {} at head {}, Adding to requested source", + source.substr(0, source.find_last_of(':')), + i + 1, ch); std::string requestSource = dev.win[static_cast(i)].selectedSource; if (requestSource == "Color Rectified Aux") { dev.channelInfo.at(ch).requestedStreams.emplace_back("Luma Rectified Aux"); - } else if (requestSource == "Color Aux") { dev.channelInfo.at(ch).requestedStreams.emplace_back("Luma Aux"); } @@ -643,8 +628,6 @@ namespace VkRender::MultiSense { const std::vector &maskVec, crl::multisense::RemoteHeadChannel idx, CRLPhysicalCamera &camPtr) { - - uint32_t bits = camPtr.getCameraInfo(idx).supportedSources; for (auto mask: maskVec) { bool enabled = (bits & mask); @@ -663,11 +646,10 @@ namespace VkRender::MultiSense { try { std::string last_element(hostAddress.substr(hostAddress.rfind('.'))); hostAddress.replace(hostAddress.rfind('.'), last_element.length(), ".2"); - } - catch (std::out_of_range &exception) { + } catch (std::out_of_range &exception) { Log::Logger::getInstance()->error( - "Trying to configure adapter '{}' with source IP: '{}', but address does not seem like an ipv4 address", - dev.interfaceName, dev.IP); + "Trying to configure adapter '{}' with source IP: '{}', but address does not seem like an ipv4 address", + dev.interfaceName, dev.IP); Log::Logger::getInstance()->error("Exception message: '{}'", exception.what()); return false; } @@ -777,7 +759,6 @@ namespace VkRender::MultiSense { Log::Logger::getInstance()->error("Section: {} Updated {} to {}", section, key, value); else Log::Logger::getInstance()->info("Section: {} Updated {} to {}", section, key, value); - } void @@ -788,7 +769,6 @@ namespace VkRender::MultiSense { Log::Logger::getInstance()->error("Section: {} deleted {}", section, key, value); else Log::Logger::getInstance()->info("Section: {} deleted {}", section, key, value); - } CameraConnection::~CameraConnection() { @@ -805,8 +785,8 @@ namespace VkRender::MultiSense { close(m_FD); #endif // !WIN32 - auto timeSpan = std::chrono::duration_cast>( - std::chrono::steady_clock::now() - startTime); + auto timeSpan = std::chrono::duration_cast >( + std::chrono::steady_clock::now() - startTime); Log::Logger::getInstance()->trace("Cameraconnection destructor stopping threadpool took {}s", timeSpan.count()); } @@ -819,13 +799,13 @@ namespace VkRender::MultiSense { auto startTime = std::chrono::steady_clock::now(); auto time = std::chrono::steady_clock::now(); std::chrono::duration timeSpan = - std::chrono::duration_cast>(time - startTime); + std::chrono::duration_cast >(time - startTime); Log::Logger::getInstance()->info("Delay connection with 10 seconds on Windows to propagate IP changes"); while (timeSpan.count() < 10.0f && !dev->interruptConnection) { time = std::chrono::steady_clock::now(); - timeSpan = std::chrono::duration_cast>(time - startTime); + timeSpan = std::chrono::duration_cast >(time - startTime); std::this_thread::sleep_for(std::chrono::milliseconds(50)); } } @@ -839,22 +819,26 @@ namespace VkRender::MultiSense { if (!dev->channelConnections.empty() && dev->state == CRL_STATE_CONNECTING) { // Check if we actually connected to a RemoteHead or not auto hwRev = app->camPtr.getCameraInfo(dev->channelConnections.front()).devInfo.hardwareRevision; - for (std::vector v{crl::multisense::system::DeviceInfo::HARDWARE_REV_MULTISENSE_REMOTE_HEAD_VPB, - crl::multisense::system::DeviceInfo::HARDWARE_REV_MULTISENSE_REMOTE_HEAD_STEREO, - crl::multisense::system::DeviceInfo::HARDWARE_REV_MULTISENSE_REMOTE_HEAD_MONOCAM}; - auto &e : v){ + for (std::vector v{ + crl::multisense::system::DeviceInfo::HARDWARE_REV_MULTISENSE_REMOTE_HEAD_VPB, + crl::multisense::system::DeviceInfo::HARDWARE_REV_MULTISENSE_REMOTE_HEAD_STEREO, + crl::multisense::system::DeviceInfo::HARDWARE_REV_MULTISENSE_REMOTE_HEAD_MONOCAM + }; + auto &e: v) { if (hwRev == e && !isRemoteHead) { dev->state = CRL_STATE_UNAVAILABLE; Log::Logger::getInstance()->error( - "User connected to a remote head but didn't check the remote head box"); + "User connected to a remote head but didn't check the remote head box"); return; } } app->updateUIDataBlock(*dev, app->camPtr); + Log::Logger::getInstance()->info("Attempting to restore last session from .ini runtime config file"); if (!isRemoteHead) app->getProfileFromIni(*dev); + // Set the resolution read from config file const auto &info = app->camPtr.getCameraInfo(dev->channelConnections.front()).devInfo; dev->cameraName = info.name; @@ -867,6 +851,8 @@ namespace VkRender::MultiSense { info.hardwareRevision == crl::multisense::system::DeviceInfo::HARDWARE_REV_MULTISENSE_MONOCAM || info.hardwareRevision == crl::multisense::system::DeviceInfo::HARDWARE_REV_MULTISENSE_KS21i; + Log::Logger::getInstance()->info("Has color camera? {}", dev->hasColorCamera); + app->m_FailedGetStatusCount = 0; app->queryStatusTimer = std::chrono::steady_clock::now(); app->queryDeviceConfigTimer = std::chrono::steady_clock::now(); @@ -877,28 +863,34 @@ namespace VkRender::MultiSense { dev->hasColorCamera ? dev->useAuxForPointCloudColor = 1 : dev->useAuxForPointCloudColor = 0; dev->hasImuSensor = app->camPtr.getCameraInfo(0).hasIMUSensor; dev->enableIMU = dev->hasImuSensor; - if (dev->hasImuSensor) + + if (dev->hasImuSensor) { + Log::Logger::getInstance()->info("Found IMU Sensor"); dev->rateTableIndex = app->camPtr.getCameraInfo(0).imuSensorConfigs.front().rateTableIndex; + } else { + Log::Logger::getInstance()->info("No IMU Sensor"); + } const auto &cInfo = app->camPtr.getCameraInfo(0).versionInfo; Log::Logger::getInstance()->info( - "Connected to {}, FW version: {}, FW Build date: {}, LibMultiSense API: {} LibMultiSense API Date: {}", - dev->cameraName, cInfo.sensorFirmwareVersion, cInfo.sensorFirmwareBuildDate, cInfo.apiVersion, - cInfo.apiBuildDate); + "Connected to {}, FW version: {}, FW Build date: {}, LibMultiSense API: {} LibMultiSense API Date: {}", + dev->cameraName, cInfo.sensorFirmwareVersion, cInfo.sensorFirmwareBuildDate, cInfo.apiVersion, + cInfo.apiBuildDate); Log::Logger::getInstance()->info("Set dev {}'s state to CRL_STATE_ACTIVE ", dev->name); } else { dev->state = CRL_STATE_UNAVAILABLE; Log::Logger::getInstance()->info("Set dev {}'s state to CRL_STATE_UNAVAILABLE ", dev->name); + Log::Logger::getInstance()->info("Failed to Connect to Ip: {}, ifName {}", dev->IP, + dev->interfaceDescription); } - - } void CameraConnection::connectFakeCameraTask(void *context, VkRender::Device *dev) { auto *app = reinterpret_cast(context); - Log::Logger::getInstance()->info("Creating Fake connection to camera. Ip: {}, ifName {}, devInfo.name: {}", dev->IP, + Log::Logger::getInstance()->info("Creating Fake connection to camera. Ip: {}, ifName {}, devInfo.name: {}", + dev->IP, dev->interfaceDescription, app->camPtr.getCameraInfo(0).devInfo.name); // If we successfully connect //dev->channelConnections = app->camPtr.connect(dev, dev->interfaceName); @@ -953,10 +945,9 @@ namespace VkRender::MultiSense { )); addIniEntry(&ini, CRLSerialNumber, "Layout", std::to_string(static_cast(dev->layout))); for (int i = 0; i <= CRL_PREVIEW_FOUR; ++i) { - std::string source = dev->win[static_cast(i)].selectedSource; std::string remoteHead = std::to_string( - dev->win[static_cast(i)].selectedRemoteHeadIndex); + dev->win[static_cast(i)].selectedRemoteHeadIndex); std::string key = "Preview" + std::to_string(i + 1); std::string value = (source.append(":" + remoteHead)); addIniEntry(&ini, CRLSerialNumber, key, value); @@ -971,7 +962,6 @@ namespace VkRender::MultiSense { dev->state = CRL_STATE_REMOVE_FROM_LIST; Log::Logger::getInstance()->info("Set dev {}'s state to CRL_STATE_REMOVE_FROM_LIST ", dev->name); Log::Logger::getInstance()->info("Deleted saved profile for serial: {}", CRLSerialNumber); - } else { dev->state = CRL_STATE_DISCONNECTED; Log::Logger::getInstance()->info("Set dev {}'s state to CRL_STATE_DISCONNECTED ", dev->name); @@ -1034,7 +1024,6 @@ namespace VkRender::MultiSense { if (app->camPtr.setResolution(arg1, idx)) { app->updateFromCameraParameters(dev, idx); } - } void CameraConnection::startStreamTask(void *context, std::string src, @@ -1094,7 +1083,6 @@ namespace VkRender::MultiSense { p->aux.gamma = auxConf.gamma(); dev->parameters.updateGuiParams = false; - } void CameraConnection::getStatusTask(void *context, crl::multisense::RemoteHeadChannel remoteHeadIndex, @@ -1113,7 +1101,6 @@ namespace VkRender::MultiSense { app->m_FailedGetStatusCount++; } // Increment a counter - } void CameraConnection::getCameraConfigsTask(void *context, crl::multisense::RemoteHeadChannel remoteHeadIndex, @@ -1154,8 +1141,5 @@ namespace VkRender::MultiSense { auto *app = reinterpret_cast(context); std::scoped_lock lock(app->writeParametersMtx); *success = app->camPtr.setSensorCalibration(intrinsicFilePath, extrinsicFilePath, index); - } - - } From 28a6ddc9f31928d29cf1afc41227996f5bf624bb Mon Sep 17 00:00:00 2001 From: mgjerde Date: Thu, 21 Nov 2024 15:14:45 +0100 Subject: [PATCH 2/4] .ini files default values would result in segfault --- src/CRLCamera/CameraConnection.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/CRLCamera/CameraConnection.cpp b/src/CRLCamera/CameraConnection.cpp index f5eb4516..8d96a02a 100644 --- a/src/CRLCamera/CameraConnection.cpp +++ b/src/CRLCamera/CameraConnection.cpp @@ -577,9 +577,7 @@ namespace VkRender::MultiSense { std::string mode = ini.GetValue(cameraSerialNumber.c_str(), ("Mode" + std::to_string(ch)).c_str(), "1"); std::string layout = ini.GetValue(cameraSerialNumber.c_str(), "Layout", "1"); - Log::Logger::getInstance()->info("Using Layout {} and camera resolution {}", layout, mode); - dev.layout = static_cast(std::stoi(layout)); dev.channelInfo.at(ch).selectedResolutionMode = static_cast(std::stoi(mode)); dev.channelInfo.at(ch).selectedModeIndex = std::stoi(mode); From 39f1fe68f9482d1b9046c5aebb656ccc96a57c70 Mon Sep 17 00:00:00 2001 From: mgjerde Date: Thu, 21 Nov 2024 15:24:39 +0100 Subject: [PATCH 3/4] Added workflow for ubuntu 24.04 version --- .github/workflows/workflow.yml | 65 ++++++++++++++++++++++++++++++- .github/workflows/workflow_pr.yml | 55 ++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c0313ec0..fa570cc0 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -246,7 +246,6 @@ jobs: # You can convert this to a matrix build if you need cross-platform coverage. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix runs-on: ubuntu-22.04 - steps: - name: print install location run: echo "My output is ${{ needs.VersionJob.outputs.install_path }}" @@ -303,3 +302,67 @@ jobs: asset_content_type: application/zip + + BuildUbuntu24: + name: Build and package for Ubuntu 24_04 + needs: [ReleaseJob, VersionJob] + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-24.04 + steps: + - name: print install location + run: echo "My output is ${{ needs.VersionJob.outputs.install_path }}" + - uses: actions/checkout@v4 + with: + submodules: 'true' + + - name: Prepare Vulkan SDK + uses: humbletim/setup-vulkan-sdk@v1.2.0 + with: + vulkan-query-version: 1.3.204.0 + vulkan-components: Vulkan-Headers, Vulkan-Loader + vulkan-use-cache: true + + - name: Install dependencies + run: sudo apt-get install -y cmake libx11-dev build-essential xorg-dev libtbb-dev libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libssl-dev libgtk-3-dev libsystemd-dev libwebp-dev + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGIT_SUBMODULE=OFF -DWARNINGS_AS_ERRORS=FALSE + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build + + - name: Install + working-directory: ${{github.workspace}}/build + run: cmake --install . --config ${{env.BUILD_TYPE}} + + - name: Prepare package step + working-directory: ${{github.workspace}}/build + run: | + mkdir ${{ needs.VersionJob.outputs.install_path }}/DEBIAN && cp ${{github.workspace}}/Assets/Tools/Ubuntu/control ${{ needs.VersionJob.outputs.install_path }}/DEBIAN/ + mkdir -p ${{ needs.VersionJob.outputs.install_path }}/usr/share/applications && cp ${{github.workspace}}/Assets/Tools/Ubuntu/multisense.desktop ${{ needs.VersionJob.outputs.install_path }}/usr/share/applications/ + cp ${{github.workspace}}/Assets/Tools/Ubuntu/start.sh ${{ needs.VersionJob.outputs.install_path }}/opt/multisense/ + rm -rf ${{ needs.VersionJob.outputs.install_path }}/opt/multisense/include + rm -rf ${{ needs.VersionJob.outputs.install_path }}/opt/multisense/lib + rm -rf ${{ needs.VersionJob.outputs.install_path }}/opt/multisense/share + + - name: Package + working-directory: ${{github.workspace}}/build + run: dpkg-deb --build --root-owner-group "${{ needs.VersionJob.outputs.install_path }}" "${{ needs.VersionJob.outputs.install_path }}_ubuntu24_04.deb" + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.ReleaseJob.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./build/${{ needs.VersionJob.outputs.install_path }}_ubuntu24_04.deb + asset_name: ${{ needs.VersionJob.outputs.install_path }}_ubuntu24_04.deb + asset_content_type: application/zip + + diff --git a/.github/workflows/workflow_pr.yml b/.github/workflows/workflow_pr.yml index c05eed08..d8d2fae8 100644 --- a/.github/workflows/workflow_pr.yml +++ b/.github/workflows/workflow_pr.yml @@ -214,3 +214,58 @@ jobs: - name: Package working-directory: ${{github.workspace}}/build run: dpkg-deb --build --root-owner-group ${{ needs.VersionJob.outputs.install_path }} + + BuildUbuntu24: + name: Build and package for Ubuntu 24_04 + needs: [VersionJob] + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-24.04 + + steps: + - name: print install location + run: echo "My output is ${{ needs.VersionJob.outputs.install_path }}" + - uses: actions/checkout@v4 + with: + submodules: 'true' + + - name: Prepare Vulkan SDK + uses: humbletim/setup-vulkan-sdk@v1.2.0 + with: + vulkan-query-version: 1.3.204.0 + vulkan-components: Vulkan-Headers, Vulkan-Loader + vulkan-use-cache: true + + - name: Install dependencies + run: sudo apt-get install -y cmake libx11-dev build-essential xorg-dev libtbb-dev libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libssl-dev libgtk-3-dev libsystemd-dev libwebp-dev + + #- name: update gcc11 + #run: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt update && sudo apt install -y gcc-11 g++-11 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGIT_SUBMODULE=OFF -DWARNINGS_AS_ERRORS=FALSE #-D CMAKE_C_COMPILER=gcc-11 -D CMAKE_CXX_COMPILER=g++-11 + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build -- -j3 + + - name: Install + working-directory: ${{github.workspace}}/build + run: cmake --install . --config ${{env.BUILD_TYPE}} + + - name: Prepare package step + working-directory: ${{github.workspace}}/build + run: | + mkdir ${{ needs.VersionJob.outputs.install_path }}/DEBIAN && cp ${{github.workspace}}/Assets/Tools/Ubuntu/control ${{ needs.VersionJob.outputs.install_path }}/DEBIAN/ + mkdir -p ${{ needs.VersionJob.outputs.install_path }}/usr/share/applications && cp ${{github.workspace}}/Assets/Tools/Ubuntu/multisense.desktop ${{ needs.VersionJob.outputs.install_path }}/usr/share/applications/ + cp ${{github.workspace}}/Assets/Tools/Ubuntu/start.sh ${{ needs.VersionJob.outputs.install_path }}/opt/multisense/ + rm -rf ${{ needs.VersionJob.outputs.install_path }}/opt/multisense/include + rm -rf ${{ needs.VersionJob.outputs.install_path }}/opt/multisense/lib + rm -rf ${{ needs.VersionJob.outputs.install_path }}/opt/multisense/share + + - name: Package + working-directory: ${{github.workspace}}/build + run: dpkg-deb --build --root-owner-group ${{ needs.VersionJob.outputs.install_path }} From 3e758939f499ea26f1f72fcfa5d07f5ff3ddd0bf Mon Sep 17 00:00:00 2001 From: mgjerde Date: Thu, 21 Nov 2024 15:32:22 +0100 Subject: [PATCH 4/4] updated autoconnect --- internal/AutoConnect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/AutoConnect b/internal/AutoConnect index 0cde86ca..9353a731 160000 --- a/internal/AutoConnect +++ b/internal/AutoConnect @@ -1 +1 @@ -Subproject commit 0cde86ca8114c8d9cf4cec9eea44480d8dc9ac2b +Subproject commit 9353a7310eacbb431562d73e6e369c66eae1a581