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

[euscollada/src/collada2eus.cpp] super ugry hack untilyaml-cpp 0.5.2 #106

Merged
merged 2 commits into from
Apr 28, 2015
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
17 changes: 14 additions & 3 deletions euscollada/src/collada2eus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ int main(int argc, char* argv[]){
add_joint_suffix = false;
nargc--;
} else if (strcmp(argv[i], "--verbose") == 0) {
verbose = false;
verbose = true;
nargc--;
}
}
Expand Down Expand Up @@ -1059,10 +1059,21 @@ int main(int argc, char* argv[]){
BOOST_FOREACH(string& limb, limb_candidates) {
#ifdef USE_CURRENT_YAML
if (doc[limb]) {
int line=-1;
ifstream fin2(yaml_filename); // super ugry hack until yaml-cpp 0.5.2
string buffer;
for (;fin2;) {
getline(fin2, buffer); line++;
if(buffer == limb+":") break;
}
fin2.close();
if (verbose) {
std::cerr << limb << "@" << doc[limb].size() << std::endl;
std::cerr << limb << "@" << line << std::endl;
}
if(line<0) {
std::cerr << limb << "@" << line << " someting is wrong..." << std::endl;
}
limb_order.push_back(pair<string, size_t>(limb, doc[limb].size()));
limb_order.push_back(pair<string, size_t>(limb, line));
}
#else
if ( doc.FindValue(limb) ) {
Expand Down
12 changes: 10 additions & 2 deletions euscollada/src/collada2eus_urdfmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,16 @@ void ModelEuslisp::readYaml (string &config_file) {
BOOST_FOREACH(string& limb, limb_candidates) {
#ifdef USE_CURRENT_YAML
if (doc[limb]) {
std::cerr << limb << "@" << doc[limb].size() << std::endl;
limb_order.push_back(pair<string, size_t>(limb, doc[limb].size()));
int line=0;
ifstream fin2(config_file.c_str()); // super ugry hack until yaml-cpp 0.5.2
string buffer;
for (;fin2;) {
getline(fin2, buffer); line++;
if(buffer == limb+":") break;
}
fin2.close();
std::cerr << limb << "@" << line << std::endl;
limb_order.push_back(pair<string, size_t>(limb, line));
}
#else
if ( doc.FindValue(limb) ) {
Expand Down