Skip to content
Snippets Groups Projects
Verified Commit 75e20e07 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Justin Carpentier
Browse files

[SRDF] Fix initialization of reference configurations.

parent 2b490867
No related branches found
No related tags found
No related merge requests found
......@@ -321,15 +321,8 @@ namespace pinocchio
if (v.first == "group_state")
{
const std::string name = v.second.get<std::string>("<xmlattr>.name");
if ( !model.referenceConfigurations.insert(std::make_pair(name, Model::ConfigVectorType::Zero(model.nq))).second)
{
// Element already present...
if (verbose) std::cout << "The reference configuration "
<< name << " has been defined multiple times. "
<<"Only the last instance of "<<name<<" is being used."
<<std::endl;
}
typename Model::ConfigVectorType& ref_config = model.referenceConfigurations.find(name)->second;
typename Model::ConfigVectorType ref_config (model.nq);
neutral (model, ref_config);
// Iterate over all the joint tags
BOOST_FOREACH(const ptree::value_type & joint_tag, v.second)
......@@ -361,6 +354,15 @@ namespace pinocchio
}
}
if ( !model.referenceConfigurations.insert(std::make_pair(name, ref_config)).second)
{
// Element already present...
if (verbose) std::cout << "The reference configuration "
<< name << " has been defined multiple times. "
<<"Only the last instance of "<<name<<" is being used."
<<std::endl;
}
}
} // BOOST_FOREACH
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment