Pick+Place: Correctly configure forwarding of "pregrasp" property

... from Grasp to UnGrasp stage
This commit is contained in:
Robert Haschke 2022-01-17 16:45:42 +01:00
parent d90b566b08
commit 95f24747b0
3 changed files with 5 additions and 1 deletions

View File

@ -36,8 +36,11 @@ PickPlaceBase::PickPlaceBase(Stage::pointer&& grasp_stage, const std::string& na
return pose;
};
const auto& forwarded_props = grasp_stage->forwardedProperties();
{
auto approach = std::make_unique<MoveRelative>(forward ? "approach object" : "retract", cartesian_solver_);
approach->setForwardedProperties(forwarded_props);
PropertyMap& p = approach->properties();
p.property("group").configureInitFrom(Stage::PARENT, "eef_parent_group");
p.property("ik_frame").configureInitFrom(Stage::PARENT, init_ik_frame);
@ -52,6 +55,7 @@ PickPlaceBase::PickPlaceBase(Stage::pointer&& grasp_stage, const std::string& na
{
auto lift = std::make_unique<MoveRelative>(forward ? "lift object" : "place object", cartesian_solver_);
lift->setForwardedProperties(forwarded_props);
PropertyMap& p = lift->properties();
p.property("group").configureInitFrom(Stage::PARENT, "eef_parent_group");
p.property("ik_frame").configureInitFrom(Stage::PARENT, init_ik_frame);

View File

@ -60,6 +60,7 @@ SimpleGraspBase::SimpleGraspBase(const std::string& name) : SerialContainer(name
void SimpleGraspBase::setup(std::unique_ptr<Stage>&& generator, bool forward) {
// properties provided by the grasp generator via its Interface or its PropertyMap
const std::set<std::string>& grasp_prop_names = { "object", "eef", "pregrasp", "grasp" };
this->setForwardedProperties(grasp_prop_names);
// insert children at end / front, i.e. normal or reverse order
int insertion_position = forward ? -1 : (generator ? 1 : 0);

View File

@ -98,7 +98,6 @@ place_generator.pose = placePose
# The SimpleUnGrasp container encapsulates releasing the object at the given Cartesian pose
simpleUnGrasp = stages.SimpleUnGrasp(place_generator, "UnGrasp")
simpleUnGrasp.pregrasp = "open"
# Place container comprises placing, ungrasping, and retracting
place = stages.Place(simpleUnGrasp, "Place")