The main function of my program is to realize a client base to the physical Robot and it receives the parameters from the robot. after some processing it links to the webot environment for visual display. so i have used a two classes with the member functions. i have given the code below. i have a class called mywebot, where the client base is initialized and the class called Output handler where it polls the robot from the clientbase and receives the data from the robot. i have given the code below. here i am linking two environments ARIA and Webot.
webot.h
Code:
class myWebot{
public:
myWebot();
myWebot(ArClientBase *xclient, int argc, char **argv);
static void myWebotReset();
static int myWebotRun(int index);
ArClientBase * getMyArClientBase();
Protected:
ArClientBase *myclient;
};
handler.h
Code:
class OutputHandler
{
public:
OutputHandler(ArClientBase *client);
virtual ~OutputHandler(void);
protected:
ArClientBase *myClient;
};
webot.cpp
Code:
ArClientBase * myWebot::getMyArClientBase(){
return myClient;
}
int myWebot::myWebotRun(int ms)
{
OutputHandler outputHandler(getMyArClientBase());
while (getMyArClientBase()->getRunningWithLock())
{
}
}
int mainLoop ()
{
robot_live(myWebotReset);
robot_run(myWebotRun);
return 0;
}
Code:
int main (int argc, char **argv)
{
ArClientBase *client =new ArClientBase();
myWebot *mw = new myWebot(client,argc,argv);
mw->mainLoop();
return 0;
}
when i am building the project with the above codes, the compiler gives me the following error the highlighted places (i.e Bold line)
c:\my_Proj\webotclient\controllers\webotclient\web ot.h(43) : see declaration of 'myWebot::getFlag'
c:\my_Proj\webotclient\controllers\webotclient\web ot.cpp(194) : error C2352: 'myWebot::getMyArClientBase' : illegal call of non-static member function
c:\my_Proj\webotclient\controllers\webotclient\web ot.h(33) : see declaration of 'myWebot::getMyArClientBase'
c:\my_Proj\webotclient\controllers\webotclient\web ot.cpp(204) : error C2352: 'myWebot::getMyArClientBase' : illegal call of non-static member function
c:\my_Proj\webotclient\controllers\webotclient\web ot.h(33) : see declaration of 'myWebot::getMyArClientBase'
c:\my_Proj\webotclient\controllers\webotclient\web ot.cpp(204) : error C2227: left of '->getRunningWithLock' must point to class/struct/union.
can anybody help me how to overcome this problem and to build the solution.