Unable to access argv value in parseCmdline function in myarm.cpp which is initialized in the constructor.
Don't know how to pass/initialize the value from main(int argc, char *argv[ ]) in constructor?
main.cpp
#include "myarm.h"
int main(int argc, char *argv[]){
cout<<"argv is:"< MyArm arm;
myarm.cpp
#include "myarm.h"
MyArm::MyArm(){
nj = 0;
done = false;
times = 0;
count = 50;
which_joint = 0;
cout<<"argv is:"< parseCmdline();
}
int MyArm::parseCmdline() {
params.fromCommand(argc, argv);
if (!params.check("robot")){
cout<<"Please specify name of the robot"< cout<<"--robot name (e.g. TechNit)"< return 1;
}
else if(!params.check("element")){
cout<<"Please specify name of the element"<
cout<<"--element name (e.g. left_arm)"< return 1;
}
}
No comments:
Post a Comment