From 106ec2bbc1e51c86615749240e5bd0caee21dae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20=C5=81ukawski?= Date: Mon, 14 Jul 2025 16:00:05 +0200 Subject: [PATCH 1/2] Add .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..011581b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +**/build*/ +/.vs/ +/.vscode/ From c971ec6efa4dbaad7599e66fe204c25016e9b9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20=C5=81ukawski?= Date: Mon, 14 Jul 2025 16:00:16 +0200 Subject: [PATCH 2/2] (PyKDL) expose ChainExternalWrenchEstimator --- python_orocos_kdl/PyKDL/dynamics.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/python_orocos_kdl/PyKDL/dynamics.cpp b/python_orocos_kdl/PyKDL/dynamics.cpp index 46d0f503..3fff5090 100644 --- a/python_orocos_kdl/PyKDL/dynamics.cpp +++ b/python_orocos_kdl/PyKDL/dynamics.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include "PyKDL.h" @@ -90,4 +91,25 @@ void init_dynamics(pybind11::module &m) chain_dyn_param.def("JntToCoriolis", &ChainDynParam::JntToCoriolis, py::arg("q"), py::arg("q_dot"), py::arg("coriolis")); chain_dyn_param.def("JntToMass", &ChainDynParam::JntToMass, py::arg("q"), py::arg("H")); chain_dyn_param.def("JntToGravity", &ChainDynParam::JntToGravity, py::arg("q"), py::arg("gravity")); + + // -------------------- + // ChainExternalWrenchEstimator + // -------------------- + py::class_ chain_ext_wrench_estimator(m, "ChainExternalWrenchEstimator"); + chain_ext_wrench_estimator.def(py::init(), + py::arg("chain"), py::arg("gravity"), py::arg("sample_frequency"), + py::arg("estimation_gain"), py::arg("filter_constant"), + py::arg("eps")=0.00001, py::arg("maxiter")=150); + chain_ext_wrench_estimator.def("setInitialMomentum", &ChainExternalWrenchEstimator::setInitialMomentum, + py::arg("joint_position"), py::arg("joint_velocity")); + chain_ext_wrench_estimator.def("setSVDEps", &ChainExternalWrenchEstimator::setSVDEps, py::arg("eps_in")); + chain_ext_wrench_estimator.def("setSVDMaxIter", &ChainExternalWrenchEstimator::setSVDMaxIter, py::arg("maxiter_in")); + chain_ext_wrench_estimator.def("JntToExtWrench", &ChainExternalWrenchEstimator::JntToExtWrench, + py::arg("joint_position"), py::arg("joint_velocity"), + py::arg("joint_torque"), py::arg("external_wrench")); + chain_ext_wrench_estimator.def("getEstimatedJntTorque", &ChainExternalWrenchEstimator::getEstimatedJntTorque, + py::arg("external_joint_torque")); + chain_ext_wrench_estimator.def("updateInternalDataStructures", &ChainExternalWrenchEstimator::updateInternalDataStructures); + chain_ext_wrench_estimator.def("strError", &ChainExternalWrenchEstimator::strError, + py::arg("error")); }