Now, I need to create an object to this class by calling the constructor from another class Robot.cpp. I can do that from a function in Robot.cpp but I cannot access it from another functions of Robot.cpp. I need to create an object say client and access it in all the functions of Robot.cpp.
Could anyone please help me in creating an object globally. The code below is Robot.h and I created static voInterpreter client which doesn't give me what I need.
#ifndef Robot_H
#define Robot_H
#include <device/robot.h>
#include "voInterpreterClient.h"
// number of DOFs of the robot
#define MAX_SERVOS 63
#define SIMULATION_STEP_DURATION 16
#define STEP_NBR 180
#define STR_BUFFER_SIZE 512
class Robot {
public:
// constructor: create robot according to specification
Robot();
Well you commented out the static variable declaration. That works if all Robots use the same instance of voInterpreterClient. (In which case you just need to instantiate the variable in Robot.cpp).
Or if all Robots have a different instance then remove the keyword "static" from the declaration of client.
[BTW: your voInterpreterClient constructor is evil. Consider that _maxInputBufferSize and _buffer are initialized only if maxInputBufferSize is >0.]