From ede5fe396f309bd0bc65c4ce40aa26a142e7a8c4 Mon Sep 17 00:00:00 2001 From: cpetersmeier Date: Tue, 6 Oct 2020 12:07:16 +0200 Subject: [PATCH] StagesWrapper: Add std::map setGoal overload. Adding a further overload of the `setGoal()` function that is exposed to the python api. This should provide an interface for passing in dicts as joint name and -angle configurations. --- core/python/test/test_mtc.py | 5 +++-- core/python/wrapper/src/stages.cpp | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/python/test/test_mtc.py b/core/python/test/test_mtc.py index 15636274..ed878ae2 100644 --- a/core/python/test/test_mtc.py +++ b/core/python/test/test_mtc.py @@ -174,9 +174,10 @@ class TestStages(unittest.TestCase): self._check(stage, "group", "group") self._check(stage, "ik_frame", PoseStamped()) stage.setGoal(PoseStamped()) - # TODO: fails - # stage.setGoal(PointStamped()) + stage.setGoal(PointStamped()) stage.setGoal(RobotState()) + stage.setGoal("named pose") + stage.setGoal(dict(joint1 = 1.0, joint2 = 2.0)) self._check(stage, "path_constraints", Constraints()) def test_MoveRelative(self): diff --git a/core/python/wrapper/src/stages.cpp b/core/python/wrapper/src/stages.cpp index 6ccd4c81..54ceb3ff 100644 --- a/core/python/wrapper/src/stages.cpp +++ b/core/python/wrapper/src/stages.cpp @@ -175,6 +175,7 @@ void export_stages() { .def("setGoal", &MoveTo::setGoal) .def("setGoal", &MoveTo::setGoal) .def("setGoal", &MoveTo::setGoal) + .def&)>("setGoal", &MoveTo::setGoal) .def("setGoal", &MoveTo::setGoal); bp::implicitly_convertible, std::auto_ptr>();