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

Renamed iterator to avoid collisions with parameter names #26

Merged
merged 2 commits into from
Jun 5, 2014
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/dynamic_reconfigure/parameter_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def add(self, name, paramtype, level, description, default = None, min = None, m
raise Exception("Max or min specified for %s, which is of string type"%name)
pattern = r'^[a-zA-Z][a-zA-Z0-9_]*$'
if not re.match(pattern, name):
raise Exception("The name of field \'%s\' is definitely not a valid C++ variable name! Change it accordingly."%name)
raise Exception("The name of field \'%s\' does not follow the ROS naming conventions, see http://wiki.ros.org/ROS/Patterns/Conventions"%name)

self.gen.fill_type(newparam)
self.gen.check_type_fill_default(newparam, 'default', self.gen.defval[paramtype])
Expand Down Expand Up @@ -438,7 +438,7 @@ def appendgroup(self, list, group):
setters = []
params = []
for p in group.parameters:
setters.append(Template(" if(\"${name}\"==(*i)->name){${name} = boost::any_cast<${ctype}>(val);}").substitute(p));
setters.append(Template(" if(\"${name}\"==(*_i)->name){${name} = boost::any_cast<${ctype}>(val);}").substitute(p));
params.append(Template("${ctype} ${name};").substitute(p));

subgroups = string.join(subgroups, "\n")
Expand Down
4 changes: 2 additions & 2 deletions src/dynamic_reconfigure/parameter_generator_catkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def add(self, name, paramtype, level, description, default = None, min = None, m
raise Exception("Max or min specified for %s, which is of string type"%name)
pattern = r'^[a-zA-Z][a-zA-Z0-9_]*$'
if not re.match(pattern, name):
raise Exception("The name of field \'%s\' is definitely not a valid C++ variable name! Change it accordingly."%name)
raise Exception("The name of field \'%s\' does not follow the ROS naming conventions, see http://wiki.ros.org/ROS/Patterns/Conventions"%name)

self.gen.fill_type(newparam)
self.gen.check_type_fill_default(newparam, 'default', self.gen.defval[paramtype])
Expand Down Expand Up @@ -421,7 +421,7 @@ def appendgroup(self, list, group):
setters = []
params = []
for p in group.parameters:
setters.append(Template(" if(\"${name}\"==(*i)->name){${name} = boost::any_cast<${ctype}>(val);}").substitute(p));
setters.append(Template(" if(\"${name}\"==(*_i)->name){${name} = boost::any_cast<${ctype}>(val);}").substitute(p));
params.append(Template("${ctype} ${name};").substitute(p));

subgroups = "\n".join(subgroups)
Expand Down
4 changes: 2 additions & 2 deletions templates/GroupClass.h.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class ${upper}

void setParams(${configname}Config &config, const std::vector<AbstractParamDescriptionConstPtr> params)
{
for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = params.begin(); i != params.end(); ++i)
for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator _i = params.begin(); _i != params.end(); ++_i)
{
boost::any val;
(*i)->getValue(config, val);
(*_i)->getValue(config, val);

${setters}
}
Expand Down