/**
* This file is part of rgbdtam.
*
* Copyright (C) 2015 Alejo Concha Belenguer <alejocb at unizar dot es> (University of Zaragoza)
* and Javier Civera Sancho   <jcivera at unizar dot es> (University of Zaragoza)
*
* rgbdtam is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* rgbdtam is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with rgbdtam. If not, see <http://www.gnu.org/licenses/>.
*/


#ifndef __VO_SYSTEM_H
#define __VO_SYSTEM_H


#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <vector>
#include <cstdio>


using namespace std;

// TIC - TOC
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include <math.h>


#include <boost/thread/thread.hpp>
#include <iostream>
#include <stdio.h>
#include <boost/filesystem.hpp>


#include <ros/ros.h>
#include <pcl_ros/point_cloud.h>
#include <pcl/point_types.h>

#include <nav_msgs/Odometry.h>
#include <sensor_msgs/Imu.h>

#include <visualization_msgs/Marker.h>

/////ROS IMAGE SUBSCRIBER
#include <iostream>
#include <ros/ros.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/image_encodings.h>
#include <cv_bridge/cv_bridge.h>
#include <opencv2/highgui/highgui.hpp>
#include <image_transport/image_transport.h>

#include "rgbdtam/superpixel.h"
#include "rgbdtam/DenseMapping.h"
#include "rgbdtam/SemiDenseTracking.h"
#include "rgbdtam/SemiDenseMapping.h"
class vo_system
{
public:
    vo_system();


    void imgcb(const sensor_msgs::Image::ConstPtr& msg);
    vector<string> left_image_names;


    DenseMapping dense_mapper;
    SemiDenseTracking semidense_tracker;
    SemiDenseMapping semidense_mapper;
    MapShared Map;
    Images_class images,images_previous_keyframe;


    int cont_frames;
    cv::Mat image_frame, cameraMatrix, distCoeffs;
    FrameStruct frame_struct;



    float depth_stamps;
    ros::Time stamps_ros;

    ros::NodeHandle nh;
    image_transport::Subscriber sub1;



    image_transport::Publisher pub_image;
    ros::Publisher odom_pub;


    ros::Publisher pub_cloud;
    ros::Publisher pub_poses;
    ros::Publisher vis_pub;


    void depthcb(const sensor_msgs::Image::ConstPtr& msg);
    ros::Time  stamps_depth_ros;
    cv::Mat image_depth;
    image_transport::Subscriber sub2;
    int counter_depth_images;

    int use_ros;

};
#endif



