The CMakeLists file escapes the Espressif Python virtual environment when generating the template.hpp, if this project is used as a component.
Current State
The provided code generates the template.hpp when using mros2-esp32 as a component. It executes within the host's Python3 environment, and not the Espressif IDF virtual Python environment set by the export.sh script before the build step.
I suggest forcing CMake to use the Espressif IDF Python virtual environment to avoid mixing the host and the virtual environment. The following change makes this possible.
In order to provide clarity on the expected behavior and environment requirements, the documentation should be updated to include information about the necessary Python environment. Currently, it only mentions the need to install Jinja2 not in which environment.
I'm more than happy to assist and create the pull request if this behavior aligns with the project's intentions. Please let me know your thoughts, and I'll proceed accordingly. ✌🏼
Short Summary
The CMakeLists file escapes the Espressif Python virtual environment when generating the template.hpp, if this project is used as a component.
Current State
The provided code generates the template.hpp when using mros2-esp32 as a component. It executes within the host's Python3 environment, and not the Espressif IDF virtual Python environment set by the export.sh script before the build step.
Proposed Change
I suggest forcing CMake to use the Espressif IDF Python virtual environment to avoid mixing the host and the virtual environment. The following change makes this possible.
Final Remarks
In order to provide clarity on the expected behavior and environment requirements, the documentation should be updated to include information about the necessary Python environment. Currently, it only mentions the need to install Jinja2 not in which environment.
I'm more than happy to assist and create the pull request if this behavior aligns with the project's intentions. Please let me know your thoughts, and I'll proceed accordingly. ✌🏼
Simon