00001 /************************************************************************************************** 00002 Software License Agreement (BSD License) 00003 00004 Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt 00005 All rights reserved. 00006 00007 Redistribution and use in source and binary forms, with or without modification, are permitted 00008 provided that the following conditions are met: 00009 00010 *Redistributions of source code must retain the above copyright notice, this list of 00011 conditions and the following disclaimer. 00012 *Redistributions in binary form must reproduce the above copyright notice, this list of 00013 conditions and the following disclaimer in the documentation and/or other materials provided 00014 with the distribution. 00015 *Neither the name of the University of Aveiro nor the names of its contributors may be used to 00016 endorse or promote products derived from this software without specific prior written permission. 00017 00018 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 00019 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00020 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 00021 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00022 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 00024 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00025 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 ***************************************************************************************************/ 00032 #ifndef _MOTION_MODEL_H_ 00033 #define _MOTION_MODEL_H_ 00034 00035 #include <kfilter/ekfilter.hpp> 00036 #include <string.h> 00037 #include <math.h> 00038 00039 enum scan_matching_method {MBICP,PSM,PLICP}; 00040 00047 class constant_velocity_nh: public Kalman::EKFilter<double,1,false,false,true> 00048 { 00049 public: 00053 constant_velocity_nh(double _l,double _dt,scan_matching_method _method); 00054 00056 double l; 00058 double dt; 00059 00063 void updateDt(double _dt); 00064 00065 protected: 00066 00070 void makeA(); 00071 00075 void makeH(); 00076 00080 void makeW(); 00081 00085 void makeV(); 00086 00090 void makeR(); 00091 00095 void makeQ(); 00096 00100 void makeProcess(); 00101 00105 void makeMeasure(); 00106 00108 scan_matching_method method; 00109 }; 00110 00111 typedef constant_velocity_nh::Vector Vector; 00112 typedef constant_velocity_nh::Matrix Matrix; 00113 00114 #endif