|
26 | 26 | #include <iostream>
|
27 | 27 | #include <iomanip>
|
28 | 28 | #include <kdl/chaindynparam.hpp>
|
| 29 | +#include <kdl/chainexternalwrenchestimator.hpp> |
29 | 30 | #include <kdl/jntspaceinertiamatrix.hpp>
|
30 | 31 | #include <kdl/kinfam_io.hpp>
|
31 | 32 | #include "PyKDL.h"
|
@@ -90,4 +91,25 @@ void init_dynamics(pybind11::module &m)
|
90 | 91 | chain_dyn_param.def("JntToCoriolis", &ChainDynParam::JntToCoriolis, py::arg("q"), py::arg("q_dot"), py::arg("coriolis"));
|
91 | 92 | chain_dyn_param.def("JntToMass", &ChainDynParam::JntToMass, py::arg("q"), py::arg("H"));
|
92 | 93 | 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")); |
93 | 115 | }
|
0 commit comments