Skip to content

Commit 61b527e

Browse files
committed
(PyKDL) expose ChainExternalWrenchEstimator
1 parent 22aaadb commit 61b527e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

python_orocos_kdl/PyKDL/dynamics.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <iostream>
2727
#include <iomanip>
2828
#include <kdl/chaindynparam.hpp>
29+
#include <kdl/chainexternalwrenchestimator.hpp>
2930
#include <kdl/jntspaceinertiamatrix.hpp>
3031
#include <kdl/kinfam_io.hpp>
3132
#include "PyKDL.h"
@@ -90,4 +91,25 @@ void init_dynamics(pybind11::module &m)
9091
chain_dyn_param.def("JntToCoriolis", &ChainDynParam::JntToCoriolis, py::arg("q"), py::arg("q_dot"), py::arg("coriolis"));
9192
chain_dyn_param.def("JntToMass", &ChainDynParam::JntToMass, py::arg("q"), py::arg("H"));
9293
chain_dyn_param.def("JntToGravity", &ChainDynParam::JntToGravity, py::arg("q"), py::arg("gravity"));
94+
95+
// --------------------
96+
// ChainExternalWrenchEstimator
97+
// --------------------
98+
py::class_<ChainExternalWrenchEstimator> chain_ext_wrench_estimator(m, "ChainExternalWrenchEstimator");
99+
chain_ext_wrench_estimator.def(py::init<const Chain&, const Vector&, const double, const double, const double, const double, const int>(),
100+
py::arg("chain"), py::arg("gravity"), py::arg("sample_frequency"),
101+
py::arg("estimation_gain"), py::arg("filter_constant"),
102+
py::arg("eps")=0.00001, py::arg("maxiter")=150);
103+
chain_ext_wrench_estimator.def("setInitialMomentum", &ChainExternalWrenchEstimator::setInitialMomentum,
104+
py::arg("joint_position"), py::arg("joint_velocity"));
105+
chain_ext_wrench_estimator.def("setSVDEps", &ChainExternalWrenchEstimator::setSVDEps, py::arg("eps_in"));
106+
chain_ext_wrench_estimator.def("setSVDMaxIter", &ChainExternalWrenchEstimator::setSVDMaxIter, py::arg("maxiter_in"));
107+
chain_ext_wrench_estimator.def("JntToExtWrench", &ChainExternalWrenchEstimator::JntToExtWrench,
108+
py::arg("joint_position"), py::arg("joint_velocity"),
109+
py::arg("joint_torque"), py::arg("external_wrench"));
110+
chain_ext_wrench_estimator.def("getEstimatedJntTorque", &ChainExternalWrenchEstimator::getEstimatedJntTorque,
111+
py::arg("external_joint_torque"));
112+
chain_ext_wrench_estimator.def("updateInternalDataStructures", &ChainExternalWrenchEstimator::updateInternalDataStructures);
113+
chain_ext_wrench_estimator.def("strError", &ChainExternalWrenchEstimator::strError,
114+
py::arg("error"));
93115
}

0 commit comments

Comments
 (0)