15 cerr <<
"Usage: " << argv_0 <<
"[-v] [-m] [-d] <robot.urdf>" << endl;
16 cerr <<
" -v | --verbose enable additional output" << endl;
17 cerr <<
" -d | --dof-overview print an overview of the degress of freedom" << endl;
18 cerr <<
" -m | --model-hierarchy print the hierarchy of the model" << endl;
19 cerr <<
" -h | --help print this help" << endl;
23 int main(
int argc,
char *argv[])
25 if(argc < 2 || argc > 4)
31 bool dof_overview =
false;
32 bool model_hierarchy =
false;
36 for(
int i = 1; i < argc; i++)
38 if(
string(argv[i]) ==
"-v" ||
string(argv[i]) ==
"--verbose")
42 else if(
string(argv[i]) ==
"-d" ||
string(argv[i]) ==
"--dof-overview")
46 else if(
string(argv[i]) ==
"-m" ||
string(argv[i]) ==
"--model-hierarchy")
48 model_hierarchy =
true;
50 else if(
string(argv[i]) ==
"-f" ||
string(argv[i]) ==
"--floatbase")
54 else if(
string(argv[i]) ==
"-h" ||
string(argv[i]) ==
"--help")
68 cerr <<
"Loading of urdf model failed!" << endl;
72 cout <<
"Model loading successful!" << endl;
76 cout <<
"Degree of freedom overview:" << endl;
82 cout <<
"Model Hierarchy:" << endl;
std::shared_ptr< Model > ModelPtr
std::string getModelHierarchy(const Model &model)
std::string getModelDOFOverview(const Model &model)
void usage(const char *argv_0)
int main(int argc, char *argv[])
bool urdfReadFromFile(const char *filename, ModelPtr model, bool floating_base, bool verbose=false)
Read urdf from file path.