Changeset 75 in pacpussensors for trunk


Ignore:
Timestamp:
Feb 3, 2015, 3:53:11 PM (10 years ago)
Author:
phudelai
Message:

Added obstacle log

Location:
trunk/StereoVisionDisparity
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/StereoVisionDisparity/CameraObstacleGridComponent.cpp

    r70 r75  
    2727// Includes, qt.
    2828#include <QMetaType>
     29#include <QDateTime>
    2930
    3031#include "Pacpus/kernel/ComponentFactory.h"
     
    195196        }
    196197
     198
     199        QString tmp = QDateTime::currentDateTimeUtc().toString("yyyy_MM_dd-hh_mm_ss") + ".txt";
     200        saveFile_.setFileName(tmp);
     201        if (!saveFile_.open(QIODevice::WriteOnly | QIODevice::Text))
     202                return;
     203        flux_.setDevice(&saveFile_);
     204        flux_.setCodec("UTF-8");
     205
    197206        // Run thread
    198207        THREAD_ALIVE = true;
     
    241250                this->udp_con = NULL;*/
    242251        }
     252
     253        saveFile_.close();
    243254
    244255        LOG_INFO("stopped component '" << name() << "'");
     
    701712       
    702713        if (dist_min < maxDistToBrake)
    703                 emit smallestDistance();
     714        {
     715                emit smallestDistance();               
     716                cout <<  "TIME TO BRAKE: " << dist_min << " m at " << road_time() << endl;
     717                flux_ <<  "TIME TO BRAKE: " << dist_min << " m at " << road_time() << endl;
     718        }
    704719
    705720        //-----------------------------------------------------------------------------
  • trunk/StereoVisionDisparity/CameraObstacleGridComponent.h

    r70 r75  
    3232#include <QThread>
    3333#include <QMutex>
     34#include <QFile.h>
     35#include <QTextStream>
    3436
    3537namespace pacpus {
     
    197199
    198200        double maxDistToBrake;
     201        QFile saveFile_;
     202        QTextStream flux_;
    199203
    200204Q_SIGNALS:
Note: See TracChangeset for help on using the changeset viewer.