-
Notifications
You must be signed in to change notification settings - Fork 9
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
[BREAKING] Move and update many component implementations to support litgen-based pybind11 generation to overhaul python library #291
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…d start fleshing out the espp library
…added color and event manager
✅Static analysis result - no issues found! ✅ |
…se them effectively
…tead of having getter/setter functions for them with the same name
…task, timer, socket, tcpsocket, udpsocket and fixed autogenerated bindings. trying to get autogeneration to work for template classes
…cilitate proper binding generation; remove TcpTransmitConfig from detail namespace and update it to be TcpSocket::TransmitConfig with alternate workaround for gcc bug; updated ftp and rtsp accordingly
…t of manual editing of the generated bindings file, but it is way better than having to write the whole thing from scratch
…::filesystem or espp::FileSystem
… shit to the beginning of every file which includes one of the socket files... -.-
…before configuring socket. updated error logging to work across platforms
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
lib
library for use with other systems / languages
litgen
python
xplat
cross platform support
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
T(0)
if ()
conditionals since that seems to break litgen parsing[BREAKING CHANGES]
espp::Gaussian
was updated to removefloat gamma() const
andvoid gamma(float)
in favor of makinggamma
public (same for beta and alpha). This was done because the existing interface was not supported by litgen since it involved overloads of the same function name, so a breaking API change was necessary, and making them public seemed to be better than changing the methods toget_*
andset_*
.espp::Task::run_on_core
has been moved outside theTask
class and into its own headerrun_on_core.hpp
, since it must be implemented in a header file, but cannot be parsed by litgen. It is now within theespp::task
namespace asespp::task::run_on_core
.espp::detail::TcpTransmitConfig
was moved into theespp::TcpSocket
class to becomeespp::TcpSocket::TransmitConfig
. This was to simplify use of litgen to not have to expose theespp::detail
namespace and to simplify the code, using an alternate workaround for the gcc bug that originally required the use of thedetail
namespace - instead we now have aDefaults()
method that we use for function default arguments.NOTE:
Right now the autogenerated bindings have to be modified since:
template <typename T> espp::RangeMapper
'sespp::RangeMapper::Config
are not handled generated by litgen properly, they result in:See:
Motivation and Context
Supporting an interface via python currently requires a lot of manual binding writing, but there are some newer tools which can help offload some or all of this work by parsing the headers and generating the bindings.
We also would like to automatically build the library in CI to ensure it is kept up to date.
How has this been tested?
Generating the python bindings and building the c++ / python libraries
From within
lib
:python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
python autogenerate_bindings.py
pre-commit run --all-files
python_bindings/pybind_espp.cpp
./build.sh
Building and running all the affected examples:
Testing python udp_client and c++ udp_server on windows (in parallels VM on MacOS):
Building and running all the c++ tests inside
pc
Running all the python tests inside
python
Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
PC Tests:
Python Tests:
Testing python using Windows library built in CI and running in a parallels windows VM:
Types of changes
Checklist:
Software
.github/workflows/build.yml
file to add my new test to the automated cloud build github action.