From a1b0501fbd63561d13fad7cab55ea4d10e3e52c9 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Tue, 6 Apr 2021 11:17:23 -0700 Subject: [PATCH] Add missing Python bindings for TSR --- python/dartpy/dynamics/InverseKinematics.cpp | 32 +++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/python/dartpy/dynamics/InverseKinematics.cpp b/python/dartpy/dynamics/InverseKinematics.cpp index 4f2cb02906b64..08116df140710 100644 --- a/python/dartpy/dynamics/InverseKinematics.cpp +++ b/python/dartpy/dynamics/InverseKinematics.cpp @@ -308,7 +308,37 @@ void InverseKinematics(py::module& m) dart::dynamics::InverseKinematics::TaskSpaceRegion::Properties>(), ::py::arg("ik"), ::py::arg("properties") - = dart::dynamics::InverseKinematics::TaskSpaceRegion::Properties()); + = dart::dynamics::InverseKinematics::TaskSpaceRegion::Properties()) + .def( + "setComputeFromCenter", + &dart::dynamics::InverseKinematics::TaskSpaceRegion:: + setComputeFromCenter, + ::py::arg("computeFromCenter"), + "Set whether this TaskSpaceRegion should compute its error vector " + "from the center of the region.") + .def( + "isComputingFromCenter", + &dart::dynamics::InverseKinematics::TaskSpaceRegion:: + isComputingFromCenter, + "Get whether this TaskSpaceRegion is set to compute its error vector " + "from the center of the region.") + .def( + "setReferenceFrame", + &dart::dynamics::InverseKinematics::TaskSpaceRegion:: + setReferenceFrame, + ::py::arg("referenceFrame"), + "Set the reference frame that the task space region is expressed. " + "Pass None to use the parent frame of the target frame instead.") + .def( + "getReferenceFrame", + &dart::dynamics::InverseKinematics::TaskSpaceRegion:: + getReferenceFrame, + "Get the reference frame that the task space region is expressed.") + .def( + "getTaskSpaceRegionProperties", + &dart::dynamics::InverseKinematics::TaskSpaceRegion:: + getTaskSpaceRegionProperties, + "Get the Properties of this TaskSpaceRegion."); ::py::class_< dart::dynamics::InverseKinematics,