Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TBB version for compiling on newer OSes #29

Merged
merged 4 commits into from
Mar 9, 2023
Merged

Conversation

FelipeMartins96
Copy link
Member

@FelipeMartins96 FelipeMartins96 commented Mar 5, 2023

This should solve #11, tested initially on arch with tbb2021.5.0

Changes:

TBB:

  • Add conditionals to TBB includes to solve conflicts with QT emit definition
  • Change cameraNode from input_node to source_node, input_node was renamed for newer TBB versions;
  • Change cameraNode Body logic to meet source_node requirements (the main change is the function now receives flow_control as parameter)
  • Update node creation to match new limiter decremeter semantics

Docker:

  • Update Dockerfile and devcontainer/Dockerfile to use ubuntu 22.04
  • Update packages name for ubuntu 22.04 names

Bugfix:

  • Solve crashing when computer had a video device called media, this was only noticed now that we were able to run outside the docker

Documentation

  • Update InstallDependencies script for qt5 package name for ubuntu22.04
  • Also updated the ubuntu version on README

TBB graph:

To make theses changes, I had to study how TBB was being used and the documentation from both versions of TBB, What I understood is that the TBB is being used in the following way:

There are 3 nodes on the graph:

tbb::flow::input_node <tbb::flow::continue_msg> _cameraNode;
tbb::flow::limiter_node <tbb::flow::continue_msg> _limiterNode;
tbb::flow::function_node<tbb::flow::continue_msg, tbb::flow::continue_msg> _visionNode;

and the edges are:

                                 ------------------------>
_cameraNode -------> _limiterNode                         _visionNode
                                 <-----(decrementer)-----

The _cameraNode get a new camera frame and if the _limiterNode counter is <1 the _limiterNode count is incremented and the _visionNode is trigered, if the _limiterNode counter is at 1 the _cameraNode waits. The _visionNode when triggered, processes the frame and when its done it decrements the _limiterNode counter.

https://spec.oneapi.io/versions/latest/elements/oneTBB/source/flow_graph/input_node_cls.html
https://oneapi-src.github.io/oneTBB/main/tbb_userguide/Data_Flow_Graph.html
documentation for specific tbb versions can be found at repo releases https://github.com/oneapi-src/oneTBB/releases

@FelipeMartins96 FelipeMartins96 added bug Something isn't working enhancement New feature or request labels Mar 5, 2023
@FelipeMartins96 FelipeMartins96 self-assigned this Mar 5, 2023
@FelipeMartins96 FelipeMartins96 linked an issue Mar 5, 2023 that may be closed by this pull request
ersaraujo
ersaraujo previously approved these changes Mar 9, 2023
@FelipeMartins96 FelipeMartins96 marked this pull request as ready for review March 9, 2023 20:19
ersaraujo
ersaraujo previously approved these changes Mar 9, 2023
@FelipeMartins96 FelipeMartins96 requested a review from bmmuc March 9, 2023 20:22
bmmuc
bmmuc previously approved these changes Mar 9, 2023
Dockerfile Show resolved Hide resolved
@ersaraujo ersaraujo dismissed stale reviews from bmmuc and themself via 1ee7cdc March 9, 2023 21:35
@FelipeMartins96 FelipeMartins96 merged commit 625a922 into main Mar 9, 2023
@FelipeMartins96 FelipeMartins96 deleted the update-tbb branch March 15, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

Software build is not working on Ubuntu 22.04 LTS
3 participants