void callback(const sensor_msgs::Image::ConstPtr imageColor, const sensor_msgs::Image::ConstPtr imageDepth, const sensor_msgs::CameraInfo::ConstPtr cameraInfoColor, const sensor_msgs::CameraInfo::ConstPtr cameraInfoDepth) { cv::Mat color, depth; readCameraInfo(cameraInfoColor, cameraMatrixColor); readCameraInfo(cameraInfoDepth, cameraMatrixDepth); readImage(imageColor, color); readImage(imageDepth, depth); // IR image input if(color.type() == CV_16U) { cv::Mat tmp; color.convertTo(tmp, CV_8U, 0.02); cv::cvtColor(tmp, color, CV_GRAY2BGR); } lock.lock(); this->color = color; this->depth = depth; updateImage = true; updateCloud = true; lock.unlock(); }
CognitionConfigurationDataProvider::CognitionConfigurationDataProvider() : theFieldDimensions(0), theCameraInfo(0), theCameraSettings(0), theCameraCalibration(0), theColorTable64(0), theRobotDimensions(0), thePassParameters(0), theDamageConfiguration(0), theHeadLimits(0), theColorConfiguration(0) { theInstance = this; readFieldDimensions(); readCameraInfo(); readCameraSettings(); readCameraCalibration(); readColorTable64(); readRobotDimensions(); readPassParameters(); readDamageConfiguration(); readHeadLimits(); readColorConfiguration(); }