.. _program_listing_file__tmp_ws_src_joystick_drivers_wiimote_include_wiimote_stat_vector_3d.hpp: Program Listing for File stat_vector_3d.hpp =========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/joystick_drivers/wiimote/include/wiimote/stat_vector_3d.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp // Copyright 2020 Intel Corporation // This program 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. // // This program 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 this program. If not, see . /* * Three dimensional statistic vector for use with the * for ROS Node which interfaces with a wiimote control unit. */ /* * Initial C++ implementation by * Mark Horn * * Revisions: * */ #pragma once #ifndef WIIMOTE__STAT_VECTOR_3D_HPP_ #define WIIMOTE__STAT_VECTOR_3D_HPP_ #include // The vector of 3 values collected to generate: // mean, standard deviation, and variance. typedef std::vector TVectorDouble; class StatVector3d { public: StatVector3d(); StatVector3d(int x, int y, int z); void clear(); int size(); void addData(int x, int y, int z); TVectorDouble getMeanRaw(); TVectorDouble getMeanScaled(double scale); TVectorDouble getVarianceRaw(); TVectorDouble getVarianceScaled(double scale); TVectorDouble getStandardDeviationRaw(); TVectorDouble getStandardDeviationScaled(double scale); private: int count_; std::vector x_; std::vector y_; std::vector z_; }; #endif // WIIMOTE__STAT_VECTOR_3D_HPP_