mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
SimpleGrasp: only use generator if it's defined
UnGrasp doesn't need a grasp generator
This commit is contained in:
parent
29ecec7403
commit
c62938a1c4
@ -62,7 +62,10 @@ void SimpleGraspBase::setup(std::unique_ptr<Stage>&& generator, bool forward)
|
|||||||
// properties provided by the grasp generator via its Interface or its PropertyMap
|
// properties provided by the grasp generator via its Interface or its PropertyMap
|
||||||
const std::set<std::string>& grasp_prop_names = { "object", "eef", "pregrasp", "grasp" };
|
const std::set<std::string>& grasp_prop_names = { "object", "eef", "pregrasp", "grasp" };
|
||||||
|
|
||||||
{
|
// insert children at end / front, i.e. normal or reverse order
|
||||||
|
int insertion_position = forward ? -1 : (generator ? 1 : 0);
|
||||||
|
|
||||||
|
if (generator) {
|
||||||
// forward properties from generator's to IK's solution (bottom -> up)
|
// forward properties from generator's to IK's solution (bottom -> up)
|
||||||
generator->setForwardedProperties(grasp_prop_names);
|
generator->setForwardedProperties(grasp_prop_names);
|
||||||
// allow inheritance in top -> down fashion as well
|
// allow inheritance in top -> down fashion as well
|
||||||
@ -79,7 +82,6 @@ void SimpleGraspBase::setup(std::unique_ptr<Stage>&& generator, bool forward)
|
|||||||
p.exposeTo(properties(), { "max_ik_solutions", "timeout", "ik_frame" });
|
p.exposeTo(properties(), { "max_ik_solutions", "timeout", "ik_frame" });
|
||||||
insert(std::unique_ptr<ComputeIK>(ik), 0); // ComputeIK always goes upfront
|
insert(std::unique_ptr<ComputeIK>(ik), 0); // ComputeIK always goes upfront
|
||||||
}
|
}
|
||||||
int insertion_position = forward ? -1 : 1; // insert children at end / front, i.e. normal or reverse order
|
|
||||||
{
|
{
|
||||||
auto allow_touch = new ModifyPlanningScene(forward ? "allow object collision" : "forbid object collision");
|
auto allow_touch = new ModifyPlanningScene(forward ? "allow object collision" : "forbid object collision");
|
||||||
allow_touch->setForwardedProperties(grasp_prop_names); // continue forwarding generator's properties
|
allow_touch->setForwardedProperties(grasp_prop_names); // continue forwarding generator's properties
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user