stat_vector_3d.h
Go to the documentation of this file.
00001 /*
00002  * Three dimensional statistic vector for use with the
00003  * for ROS Node which interfaces with a wiimote control unit.
00004  * Copyright (c) 2016, Intel Corporation.
00005  *
00006  * This program is free software; you can redistribute it and/or modify it
00007  * under the terms and conditions of the GNU General Public License,
00008  * version 2, as published by the Free Software Foundation.
00009  *
00010  * This program is distributed in the hope it will be useful, but WITHOUT
00011  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
00013  * more details.
00014  */
00015 
00016 /*
00017  * Initial C++ implementation by
00018  *   Mark Horn <mark.d.horn@intel.com>
00019  *
00020  * Revisions:
00021  *
00022  */
00023 
00024 #pragma once
00025 #ifndef WIIMOTE_STAT_VECTOR_3D_H
00026 #define WIIMOTE_STAT_VECTOR_3D_H
00027 
00028 #include <vector>
00029 #include <numeric>
00030 #include <algorithm>
00031 #include <math.h>
00032 
00033 // The vector of 3 values collected to generate:
00034 // mean, standard deviation, and variance.
00035 
00036 typedef std::vector<double> TVectorDouble;
00037 
00038 class StatVector3d
00039 {
00040 public:
00041   StatVector3d();
00042   StatVector3d(int x, int y, int z);
00043 
00044   void clear();
00045 
00046   int size();
00047   void addData(int x, int y, int z);
00048 
00049   TVectorDouble getMeanRaw();
00050   TVectorDouble getMeanScaled(double scale);
00051   TVectorDouble getVarianceRaw();
00052   TVectorDouble getVarianceScaled(double scale);
00053   TVectorDouble getStandardDeviationRaw();
00054   TVectorDouble getStandardDeviationScaled(double scale);
00055 
00056 private:
00057   int count_;
00058   std::vector<int> x_;
00059   std::vector<int> y_;
00060   std::vector<int> z_;
00061 };
00062 
00063 #endif  // WIIMOTE_STAT_VECTOR_3D_H


wiimote
Author(s): Andreas Paepcke, Melonee Wise, Mark Horn
autogenerated on Sat Jun 8 2019 20:54:41