From 0d7163d1538bb27c1a3ae0a9cece1b0974761882 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 31 Jul 2024 09:01:32 -0500 Subject: [PATCH] update bindings --- lib/python_bindings/espp/__init__.pyi | 88 +++++++++++++++++++++++---- lib/python_bindings/pybind_espp.cpp | 42 ++++++++----- 2 files changed, 104 insertions(+), 26 deletions(-) diff --git a/lib/python_bindings/espp/__init__.pyi b/lib/python_bindings/espp/__init__.pyi index a5ffe123c..1ccbdcb9f 100644 --- a/lib/python_bindings/espp/__init__.pyi +++ b/lib/python_bindings/espp/__init__.pyi @@ -781,6 +781,8 @@ class Gaussian: * * \section gaussian_ex1 Example * \snippet math_example.cpp gaussian example + * \section gaussian_ex2 Fade-In/Fade-Out Example + * \snippet math_example.cpp gaussian fade in fade out example """ class Config: @@ -815,18 +817,80 @@ class Gaussian: """ pass - gamma: float #/ None: - """Auto-generated default constructor with named params""" + def update(self, config: Gaussian.Config) -> None: + """* + * @brief Update the gaussian configuration. + * @param config The new configuration. + + """ + pass + + def set_config(self, config: Gaussian.Config) -> None: + """* + * @brief Set the configuration of the gaussian. + * @param config The new configuration. + + """ + pass + + def get_config(self) -> Gaussian.Config: + """* + * @brief Get the current configuration of the gaussian. + * @return The current configuration. + + """ + pass + + def get_gamma(self) -> float: + """* + * @brief Get the gamma value. + * @return The gamma value. + + """ + pass + + def get_alpha(self) -> float: + """* + * @brief Get the alpha value. + * @return The alpha value. + + """ + pass + + def get_beta(self) -> float: + """* + * @brief Get the beta value. + * @return The beta value. + + """ + pass + + def set_gamma(self, gamma: float) -> None: + """* + * @brief Set the gamma value. + * @param gamma The new gamma value. + + """ + pass + + def set_alpha(self, alpha: float) -> None: + """* + * @brief Set the alpha value. + * @param alpha The new alpha value. + + """ + pass + + def set_beta(self, beta: float) -> None: + """* + * @brief Set the beta value. + * @param beta The new beta value. + + """ + pass + + def __init__(self) -> None: + """Auto-generated default constructor""" pass #################### #################### diff --git a/lib/python_bindings/pybind_espp.cpp b/lib/python_bindings/pybind_espp.cpp index 1bccafea4..802d925ac 100644 --- a/lib/python_bindings/pybind_espp.cpp +++ b/lib/python_bindings/pybind_espp.cpp @@ -339,12 +339,11 @@ void py_init_module_espp(py::module &m) { } // end of inner classes & enums of Bezier_espp_Vector2f pyClassBezier_espp_Vector2f.def(py::init::Config &>()) - .def(py::init::WeightedConfig &>()) + .def(py::init::Config &>()) .def("__call__", &espp::Bezier::operator(), py::arg("t"), "*\n * @brief Evaluate the bezier at \\p t.\n * @note Convienience wrapper around " - "the " - "at() method.\n * @param t The evaluation parameter, [0, 1].\n * @return The bezier " - "evaluated at \\p t.\n"); + "the at() method.\n * @param t The evaluation parameter, [0, 1].\n * @return The " + "bezier evaluated at \\p t.\n"); //////////////////// //////////////////// //////////////////// //////////////////// @@ -425,7 +424,8 @@ void py_init_module_espp(py::module &m) { "\\f$y(t)=\\alpha\\exp(-\\frac{(t-\\beta)^2}{2\\gamma^2})\\f$.\n * @details Alows you to " "store the alpha, beta, and gamma coefficients as well\n * as update them " "dynamically.\n *\n * \\section gaussian_ex1 Example\n * \\snippet math_example.cpp gaussian " - "example\n"); + "example\n * \\section gaussian_ex2 Fade-In/Fade-Out Example\n * \\snippet math_example.cpp " + "gaussian fade in fade out example\n"); { // inner classes & enums of Gaussian auto pyClassGaussian_ClassConfig = @@ -457,13 +457,27 @@ void py_init_module_espp(py::module &m) { "*\n * @brief Evaluate the gaussian at \\p t.\n * @note Convienience wrapper around " "the at() method.\n * @param t The evaluation parameter, [0, 1].\n * @return The " "gaussian evaluated at \\p t.\n") - .def_readwrite( - "gamma", &espp::Gaussian::gamma, - "/ //////////////////// //////////////////// //////////////////// @@ -536,7 +550,7 @@ void py_init_module_espp(py::module &m) { "the input distribution."); } // end of inner classes & enums of RangeMapper_int - pyClassRangeMapper_int.def(py::init<>()) + pyClassRangeMapper_int.def(py::init::Config &>()) .def("get_center_deadband", &espp::RangeMapper::get_center_deadband, "*\n * @brief Return the configured deadband around the center of the input\n * " " distribution\n * @return Deadband around the center of the input distribution for " @@ -658,7 +672,7 @@ void py_init_module_espp(py::module &m) { "the input distribution."); } // end of inner classes & enums of RangeMapper_float - pyClassRangeMapper_float.def(py::init<>()) + pyClassRangeMapper_float.def(py::init::Config &>()) .def("get_center_deadband", &espp::RangeMapper::get_center_deadband, "*\n * @brief Return the configured deadband around the center of the input\n * " " distribution\n * @return Deadband around the center of the input distribution for "