Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Change in Parameter Extraction on Parameters on CFFParser #58

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions rosplan_planning_system/src/PlanParsing/CFFPlanParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,28 +159,22 @@ namespace KCL_rosplan {
while(!finished && !infile.eof()) {
for(std::string::iterator it = params.begin(); it != params.end(); ++it) {
switch (state) {
case 0: // reading parameter
if (*it == '-' || *it == ' ') {
// std::cout << params.substr(count_start,count_length) << std::endl;
operator_parameter_map[action_name].push_back(params.substr(count_start,count_length));
case 0://looking for parameter started with ?
if (*it == '?') {
count_start = count_start + count_length;
count_length = 0;
state++;
}
break;
case 1: // skipping " - "
if (*it != '-' && *it != ' ') state++;
break;
case 2: // skipping type
if (*it == ' ') state++;
break;
case 3: // skipping spaces
if (*it != ' ') {
count_start = count_start + count_length;
count_length = 0;
state = 0;

case 1://getting parameter
if (*it == ' ' || *it == ')') {
operator_parameter_map[action_name].push_back(params.substr(count_start,count_length));
state =0;
}
break;
}

count_length++;

if (*it == ')') {
Expand Down