Buoy::Buoy(std::string name) : _it(_n), _s(_n, name, boost::bind(&Buoy::executCB, this, _1), false), _actionName(name) { _sub = _it.subscribe("videoimage", 1, &Buoy::imageCallBack, this); _pub = _it.advertise("bottomcamprocessed", 1); ifstream _thresholdVal("/home/madhukar/threshold.th"); if(_thresholdVal.is_open()) { for(int i = 0; i < 3; i++) { _thresholdVal >> _lowerThresh[i]; } for(int i = 0; i < 3; i++) { _thresholdVal >> _upperThresh[i]; } } else {
Vgate::Vgate(std::string name) : _it(_n), _s(_n, name, boost::bind(&Vgate::executCB, this, _1), false), _actionName(name) { _sub = _it.subscribe(topics::CAMERA_BOTTOM_RAW_IMAGE, 1, &Vgate::imageCallBack, this); _pub = _it.advertise(topics::CAMERA_BOTTOM_VGATE_IMAGE, 1); ifstream _thresholdVal("threshold.th"); if(_thresholdVal.is_open()) { for(int i = 0; i < 3; i++) { _thresholdVal >> _lowerThresh[i]; } for(int i = 0; i < 3; i++) { _thresholdVal >> _upperThresh[i]; } } else {
Buoy::Buoy(std::string name) : _it(_n), _s(_n, name, boost::bind(&Buoy::executeCB, this, _1), false), _actionName(name) { _sub = _it.subscribe(topics::CAMERA_FRONT_RAW_IMAGE, 1, &Buoy::imageCallBack, this); _pub = _it.advertise(topics::CAMERA_FRONT_BUOY_IMAGE, 1); _buoy_coord_pub = _nh.advertise<kraken_msgs::positionData>("/kraken/buoy/coordinates/", 1); max = 0; ifstream _thresholdVal("threshold.th"); if(_thresholdVal.is_open()) { for(int i = 0; i < 3; i++) { _thresholdVal >> _lowerThreshYellow[i]; } for(int i = 0; i < 3; i++) { _thresholdVal >> _upperThreshYellow[i]; } // for(int i = 0; i < 3; i++) // { // _thresholdVal >> _lowerThreshRed2[i]; // } // for(int i = 0; i < 3; i++) // { // _thresholdVal >> _upperThreshRed2[i]; // } /*for(int i = 0; i < 3; i++) { _thresholdVal >> _lowerThreshGreen[i]; } for(int i = 0; i < 3; i++) { _thresholdVal >> _upperThreshGreen[i]; }*/ } else {