00001 /* 00002 * Copyright (c) 2013 University of Jaume-I. 00003 * All rights reserved. This program and the accompanying materials 00004 * are made available under the terms of the GNU Public License v3.0 00005 * which accompanies this distribution, and is available at 00006 * http://www.gnu.org/licenses/gpl.html 00007 * 00008 * Contributors: 00009 * Mario Prats 00010 * Javier Perez 00011 */ 00012 00013 #ifndef INERTIALMEASUREMENTUNIT_H_ 00014 #define INERTIALMEASUREMENTUNIT_H_ 00015 00016 #include <osg/Vec3d> 00017 #include <osg/Node> 00018 #include <osg/Matrix> 00019 #include <osg/Group> 00020 00021 #include <boost/random.hpp> 00022 00023 class InertialMeasurementUnit 00024 { 00025 00026 public: 00027 std::string name; 00028 00035 InertialMeasurementUnit(std::string imu_name, osg::Node *imu_parent, osg::Matrixd rMl, double imu_std = 0) : 00036 name(imu_name), parent_(imu_parent), rMl_(rMl), std_(imu_std) 00037 { 00038 imu_node_ = new osg::Node(); 00039 imu_parent->asGroup()->addChild(imu_node_); 00040 } 00041 00042 osg::Quat getMeasurement(); 00043 00044 double getStandardDeviation() 00045 { 00046 return std_; 00047 } 00048 00049 virtual ~InertialMeasurementUnit() 00050 { 00051 } 00052 00053 private: 00054 osg::ref_ptr<osg::Node> parent_; 00055 osg::Matrixd rMl_; 00056 double std_; 00057 osg::ref_ptr<osg::Node> imu_node_; 00058 00059 boost::mt19937 rng_; 00060 }; 00061 00062 #endif /* INERTIALMEASUREMENTUNIT_H_ */