Revision 32327f15 include/humotion/timestamped_float.h
| include/humotion/timestamped_float.h | ||
|---|---|---|
| 30 | 30 | 
    #include <stdio.h>  | 
| 31 | 31 | 
    #include <unistd.h>  | 
| 32 | 32 | 
    #include <string>  | 
| 33 | 
    #include "timestamp.h"  | 
|
| 33 | 34 | 
     | 
| 34 | 35 | 
    namespace humotion{
   | 
| 35 | 36 | 
     | 
| 36 | 37 | 
    class TimestampedFloat{
   | 
| 37 | 38 | 
    public:  | 
| 38 | 
        TimestampedFloat(){
   | 
|
| 39 | 
    timestamp = 0.0;  | 
|
| 39 | 
        TimestampedFloat() : timestamp(0, 0){
   | 
|
| 40 | 40 | 
    value = 0.0;  | 
| 41 | 41 | 
    }  | 
| 42 | 42 | 
     | 
| 43 | 
        TimestampedFloat(double ts, float val){
   | 
|
| 43 | 
        TimestampedFloat(Timestamp ts, float val){
   | 
|
| 44 | 44 | 
    timestamp = ts;  | 
| 45 | 45 | 
    value = val;  | 
| 46 | 46 | 
    }  | 
| 47 | 47 | 
     | 
| 48 | 
    	static double get_timestamp(){
   | 
|
| 48 | 
        /*static double get_timestamp(){
   | 
|
| 49 | 49 | 
    //fetch time  | 
| 50 | 50 | 
    struct timespec tp;  | 
| 51 | 51 | 
    clock_gettime(CLOCK_REALTIME, &tp);  | 
| 52 | 52 | 
    return tp.tv_sec+tp.tv_nsec/1000000000.0;  | 
| 53 | 
    	};
   | 
|
| 53 | 
        };*/
   | 
|
| 54 | 54 | 
     | 
| 55 | 
    	double timestamp;
   | 
|
| 55 | 
        Timestamp timestamp;
   | 
|
| 56 | 56 | 
    float value;  | 
| 57 | 57 | 
     | 
| 58 | 58 | 
    };  | 
Also available in: Unified diff