icub-tech-iit / ergocub-software

Main collector of ergoCub specific SW
https://icub-tech-iit.github.io/ergocub-software/
BSD 3-Clause "New" or "Revised" License
13 stars 18 forks source link

ergoCubEmotions: avoid reading videos at each update of the module #214

Closed martinaxgloria closed 7 months ago

martinaxgloria commented 7 months ago

This should fix https://github.com/icub-tech-iit/ergocub-software/issues/213. I tried to launch the module after these changes on my laptop and the cpu consumption significantly decreased.

To be tested on ergocub-head.

martinaxgloria commented 7 months ago

I modified the code to open only the transitions at runtime, while the "static" video are opened in the configuration and then read in the updateModule when the correspondent command is set. In this way, only 4 videos are saved in memory, instead of 16 (videos + transitions). This is the result tested on my laptop:

Screencast from 01-23-2024 03:14:16 PM.webm

I'm going to test it on ergoCub.

cc @traversaro @GiulioRomualdi @Nicogene

martinaxgloria commented 7 months ago

I did the test on the ergocub-head on bench and this is what I obtaned:

https://github.com/icub-tech-iit/ergocub-software/assets/114698424/4b70f63b-5461-4525-b882-caf83c992851

@GiulioRomualdi, @S-Dafarra, @traversaro could you please review?