6 : footstep_planner(footstep_planner)
7 , step_plan(new StepPlan())
31 return this->step_plan->fromMsg(step_plan);
36 return this->step_plan->toMsg(step_plan);
41 msgs::ErrorStatus status;
42 StepPlan temp_step_plan;
45 for (std::vector<msgs::StepPlan>::const_iterator itr = step_plans.begin(); itr != step_plans.end() && status.error == msgs::ErrorStatus::NO_ERROR; itr++)
46 status += temp_step_plan.appendStepPlan(*itr);
48 status += temp_step_plan.toMsg(result);
54 msgs::ErrorStatus status;
55 StepPlan temp_step_plan;
58 for (std::vector<msgs::StepPlan>::const_iterator itr = step_plans.begin(); itr != step_plans.end() && status.error == msgs::ErrorStatus::NO_ERROR; itr++)
59 status += temp_step_plan.stitchStepPlan(*itr);
61 status += temp_step_plan.toMsg(result);
69 msgs::ErrorStatus status;
70 StepPlan temp_step_plan(step_plan);
71 msgs::StepPlan temp_step_plan_msg;
74 msgs::UpdateMode update_mode;
75 switch (edit_step.plan_mode)
77 case msgs::EditStep::EDIT_MODE_REMOVE:
79 if (!temp_step_plan.hasStep(edit_step.step.step_index))
80 status += ErrorStatusError(msgs::ErrorStatus::ERR_UNKNOWN,
"GlobalFootstepPlanner",
"editStep: Step with index " + boost::lexical_cast<std::string>(edit_step.step.step_index) +
" was not found!");
82 temp_step_plan.removeStep(edit_step.step.step_index);
84 case msgs::EditStep::EDIT_MODE_2D:
85 update_mode.mode = msgs::UpdateMode::UPDATE_MODE_Z;
87 case msgs::EditStep::EDIT_MODE_3D:
88 update_mode.mode = msgs::UpdateMode::UPDATE_MODE_3D;
90 case msgs::EditStep::EDIT_MODE_FULL:
93 status += ErrorStatusError(msgs::ErrorStatus::ERR_UNKNOWN,
"GlobalFootstepPlanner",
"editStep: Invalid plan mode: " + boost::lexical_cast<std::string>(edit_step.plan_mode));
98 if (edit_step.plan_mode != msgs::EditStep::EDIT_MODE_REMOVE)
101 msgs::Step
step = edit_step.step;
102 if (update_mode.mode)
106 status += temp_step_plan.updateStep(step);
107 status += temp_step_plan.toMsg(temp_step_plan_msg);
110 footstep_planner->updateStepPlan(temp_step_plan_msg, msgs::UpdateMode::UPDATE_MODE_CHECK_VALIDITY);
113 status += temp_step_plan.toMsg(temp_step_plan_msg);
116 if (temp_step_plan_msg.steps.size() && status.warning == msgs::ErrorStatus::WARN_INCOMPLETE_STEP_PLAN)
118 msgs::StepPlan sub_step_plan;
119 sub_step_plan.header = temp_step_plan_msg.header;
120 sub_step_plan.data = temp_step_plan_msg.data;
123 unsigned int next_index = temp_step_plan_msg.steps.front().step_index;
124 for (
unsigned int i = 0; i < temp_step_plan_msg.steps.size(); i++)
126 msgs::Step&
step = temp_step_plan_msg.steps[i];
128 if (step.step_index != static_cast<int>(next_index++) || i == temp_step_plan_msg.steps.size()-1)
130 result.push_back(sub_step_plan);
131 sub_step_plan.steps.clear();
132 next_index = step.step_index+1;
135 sub_step_plan.steps.push_back(step);
139 result.push_back(temp_step_plan_msg);
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())