GraftUKFVelocity.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2013, Willow Garage, Inc.
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions are met:
00007  *
00008  *     * Redistributions of source code must retain the above copyright
00009  *       notice, this list of conditions and the following disclaimer.
00010  *     * Redistributions in binary form must reproduce the above copyright
00011  *       notice, this list of conditions and the following disclaimer in the
00012  *       documentation and/or other materials provided with the distribution.
00013  *     * Neither the name of the Willow Garage, Inc. nor the names of its
00014  *       contributors may be used to endorse or promote products derived from
00015  *       this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00018  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00021  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00022  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00023  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00024  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00025  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00026  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00027  * POSSIBILITY OF SUCH DAMAGE.
00028  */
00029 
00030 /* 
00031  * Author: Chad Rockey
00032  */
00033 
00034 #ifndef GRAFT_UKFVELOCITY_H
00035 #define GRAFT_UKFVELOCITY_H
00036 
00037 #include <Eigen/Dense>
00038 #include <Eigen/Cholesky>
00039 
00040 #include <graft/GraftState.h>
00041 #include <nav_msgs/Odometry.h>
00042 #include <geometry_msgs/QuaternionStamped.h>
00043 #include <sensor_msgs/Imu.h>
00044 #include <tf/transform_datatypes.h>
00045  #include <graft/GraftSensor.h>
00046 
00047 #define SIZE 3  // State size: vx, vy, wz
00048 
00049 using namespace Eigen;
00050 
00051 class GraftUKFVelocity{
00052   public:
00053     GraftUKFVelocity();
00054     ~GraftUKFVelocity();
00055 
00056         MatrixXd f(MatrixXd x, double dt);
00057 
00058         std::vector<MatrixXd > predict_sigma_points(std::vector<MatrixXd >& sigma_points, double dt);
00059 
00060         graft::GraftStatePtr getMessageFromState();
00061 
00062         graft::GraftStatePtr getMessageFromState(Matrix<double, SIZE, 1>& state, Matrix<double, SIZE, SIZE>& covariance);
00063 
00064         double predictAndUpdate();
00065 
00066         void setTopics(std::vector<boost::shared_ptr<GraftSensor> >& topics);
00067 
00068         void setInitialCovariance(std::vector<double>& P);
00069 
00070         void setProcessNoise(std::vector<double>& Q);
00071 
00072         void setAlpha(const double alpha);
00073 
00074         void setKappa(const double kappa);
00075 
00076         void setBeta(const double beta);
00077     
00078   private:
00079 
00080     Matrix<double, SIZE, 1> graft_state_;
00081         Matrix<double, SIZE, 1> graft_control_;
00082         Matrix<double, SIZE, SIZE> graft_covariance_;
00083 
00084         Matrix<double, SIZE, SIZE> Q_;
00085 
00086     ros::Time last_update_time_;
00087     ros::Time last_imu_time_;
00088 
00089     double alpha_;
00090     double beta_;
00091     double kappa_;
00092 
00093     std::vector<boost::shared_ptr<GraftSensor> > topics_;
00094 };
00095 
00096 #endif


graft
Author(s): Chad Rockey
autogenerated on Thu Feb 11 2016 22:58:40