Skip to content

Instantly share code, notes, and snippets.

@iamrajee
Created February 18, 2020 07:06
Show Gist options
  • Save iamrajee/be3d2c60e31739ffc49504d471ec67d3 to your computer and use it in GitHub Desktop.
Save iamrajee/be3d2c60e31739ffc49504d471ec67d3 to your computer and use it in GitHub Desktop.
// ====================== Current State ====================== //
{
auto _current_state = std::make_unique<stages::CurrentState>("current state");
t.add(std::move(_current_state));
}
// ====================== test container ====================== //
{
// auto test_container = std::make_unique<SerialContainer>("test container"); //calculate and run both serially
// auto test_container = std::make_unique<Alternatives>("test container"); //calculate both and possible run both seperatly
// auto test_container = std::make_unique<Fallbacks>("test container"); //calculate and run either of
auto test_container = std::make_unique<Merger>("test container");//calculate and run both same time
{
auto test_container2 = std::make_unique<SerialContainer>("test container2"); //worked fine !!
// ====================== Move to Home ====================== //
{
auto stage = std::make_unique<stages::MoveTo>("move home", sampling_planner);
stage->setGroup(arm_group_name_);
stage->setGoal(arm_home_pose_);
stage->restrictDirection(stages::MoveTo::FORWARD);
test_container2->insert(std::move(stage));
}
// ====================== Open Hand ====================== //
{
auto stage = std::make_unique<stages::MoveTo>("open hand", sampling_planner);
stage->setGroup(hand_group_name_);
stage->setGoal(hand_open_pose_);
stage->restrictDirection(stages::MoveTo::FORWARD);
// t.add(std::move(stage));
test_container2->insert(std::move(stage));
}
test_container.insert(std::move(test_container2));
}
{
auto test_container2 = std::make_unique<SerialContainer>("test container2"); //worked fine !!
// ====================== Move to Home 2 ====================== //
{
auto stage = std::make_unique<stages::MoveTo>("move home2", sampling_planner);
stage->setGroup(arm2_group_name_);
stage->setGoal(arm2_home_pose_);
stage->restrictDirection(stages::MoveTo::FORWARD);
test_container2->insert(std::move(stage));
}
// ====================== Open Hand ====================== //
{
auto stage = std::make_unique<stages::MoveTo>("open hand2", sampling_planner);
stage->setGroup(hand2_group_name_);
stage->setGoal(hand2_open_pose_);
stage->restrictDirection(stages::MoveTo::FORWARD);
// t.add(std::move(stage));
test_container2->insert(std::move(stage));
}
test_container.insert(std::move(test_container2));
}
t.add(std::move(test_container));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment