From 2e4608252156b792713473fb84378d62badd09f0 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Sun, 3 Jun 2018 01:55:07 +0200 Subject: [PATCH] remove Container::exposePropertiesOfChild() --- .../moveit/task_constructor/container.h | 6 ---- core/src/container.cpp | 34 ------------------- core/src/stages/simple_grasp.cpp | 2 -- 3 files changed, 42 deletions(-) diff --git a/core/include/moveit/task_constructor/container.h b/core/include/moveit/task_constructor/container.h index 7b506e78..d8b46490 100644 --- a/core/include/moveit/task_constructor/container.h +++ b/core/include/moveit/task_constructor/container.h @@ -62,12 +62,6 @@ public: virtual bool remove(int pos); virtual void clear(); - /// declare all given variables of child and configure child to inherit them from parent - void exposePropertiesOfChild(int child, const std::initializer_list& names, bool skip_undefined = false); - /// declare given child property with another name and configure child to inherit it from parent - void exposePropertyOfChildAs(int child, const std::string& child_property_name, - const std::string& parent_property_name, bool skip_undefined = false); - void reset() override; void init(const moveit::core::RobotModelConstPtr& robot_model) override; /// validate connectivity of children (after init() was done) diff --git a/core/src/container.cpp b/core/src/container.cpp index c91cf6c1..b39e36ec 100644 --- a/core/src/container.cpp +++ b/core/src/container.cpp @@ -194,40 +194,6 @@ void ContainerBase::clear() pimpl()->children_.clear(); } -void ContainerBase::exposePropertiesOfChild(int child, const std::initializer_list& names, bool skip_undefined) -{ - auto impl = pimpl(); - ContainerBasePrivate::const_iterator child_it = impl->childByIndex(child, false); - if (child_it == impl->children().end()) - throw std::runtime_error("invalid child index"); - - PropertyMap &source = (*child_it)->properties(); - PropertyMap &target = impl->properties_; - for (const std::string& name : names) { - if (skip_undefined && !source.hasProperty(name)) - continue; - // declare variables - source.exposeTo(target, name, name); - } -} - -void ContainerBase::exposePropertyOfChildAs(int child, const std::string& child_property_name, - const std::string& parent_property_name, bool skip_undefined) -{ - auto impl = pimpl(); - ContainerBasePrivate::const_iterator child_it = impl->childByIndex(child, false); - if (child_it == impl->children().end()) - throw std::runtime_error("invalid child index"); - - PropertyMap &source = (*child_it)->properties(); - PropertyMap &target = impl->properties_; - if (skip_undefined && !source.hasProperty(child_property_name)) - return; - - // declare variables - source.exposeTo(target, child_property_name, parent_property_name); -} - void ContainerBase::reset() { auto impl = pimpl(); diff --git a/core/src/stages/simple_grasp.cpp b/core/src/stages/simple_grasp.cpp index de1c4394..315b166b 100644 --- a/core/src/stages/simple_grasp.cpp +++ b/core/src/stages/simple_grasp.cpp @@ -78,7 +78,6 @@ void SimpleGraspBase::setup(std::unique_ptr&& generator, bool forward) p.configureInitFrom(Stage::PARENT | Stage::INTERFACE, {"eef", "ik_frame"}); // derive from both p.exposeTo(properties(), { "max_ik_solutions", "timeout", "ik_frame" }); insert(std::unique_ptr(ik), insertion_position); -// exposePropertiesOfChild(insertion_position, { "max_ik_solutions", "timeout", "ik_frame" }); } { auto allow_touch = new ModifyPlanningScene(forward ? "allow object collision" : "forbid object collision"); @@ -116,7 +115,6 @@ void SimpleGraspBase::setup(std::unique_ptr&& generator, bool forward) p.property("goal").configureInitFrom(Stage::PARENT | Stage::INTERFACE, forward ? "grasp" : "pregrasp"); p.exposeTo(properties(), { "group", "goal" }); insert(std::unique_ptr(move), insertion_position); -// exposePropertyOfChildAs(insertion_position, "goal", forward ? "grasp" : "pregrasp", true); } { auto attach = new ModifyPlanningScene(forward ? "attach object" : "detach object");