From f3659da82b2658ee516ba73bc772320524d2abf6 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Sat, 15 Feb 2025 19:34:39 +0100 Subject: [PATCH] Pick with custom max_velocity_scaling_factor during approach+lift --- core/python/bindings/src/stages.cpp | 2 ++ core/python/test/test_mtc.py | 1 + demo/scripts/pickplace.py | 2 ++ 3 files changed, 5 insertions(+) diff --git a/core/python/bindings/src/stages.cpp b/core/python/bindings/src/stages.cpp index 9d8a63b0..4924382a 100644 --- a/core/python/bindings/src/stages.cpp +++ b/core/python/bindings/src/stages.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -434,6 +435,7 @@ void export_stages(pybind11::module& m) { .property("eef_parent_group", "str: Joint model group of the eef's parent") .def(py::init(), "grasp_generator"_a, "name"_a = std::string("pick")) + .def_property_readonly("cartesian_solver", &Pick::cartesianSolver) .def("setApproachMotion", &Pick::setApproachMotion, R"( The approaching motion towards the grasping state is represented by a twist message. diff --git a/core/python/test/test_mtc.py b/core/python/test/test_mtc.py index ff1d7076..b584ab1e 100644 --- a/core/python/test/test_mtc.py +++ b/core/python/test/test_mtc.py @@ -228,6 +228,7 @@ class TestStages(unittest.TestCase): self._check(stage, "eef_frame", "eef_frame") self._check(stage, "eef_group", "eef_group") self._check(stage, "eef_parent_group", "eef_parent_group") + self._check(stage.cartesian_solver, "max_velocity_scaling_factor", 0.1) def test_Place(self): generator_stage = stages.GeneratePose("generator") diff --git a/demo/scripts/pickplace.py b/demo/scripts/pickplace.py index 709b786c..89ea0ab2 100755 --- a/demo/scripts/pickplace.py +++ b/demo/scripts/pickplace.py @@ -98,6 +98,8 @@ approach.header.frame_id = "world" approach.twist.linear.z = -1.0 pick.setApproachMotion(approach, 0.03, 0.1) +pick.cartesian_solver.max_velocity_scaling_factor = 0.1 + # Twist to lift the object lift = TwistStamped() lift.header.frame_id = "panda_hand"