00001 /************************************************************************************************** 00002 Software License Agreement (BSD License) 00003 00004 Copyright (c) 2011-2014, 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 ***************************************************************************************************/ 00033 #define PHANTOMFILTER_H 00034 00035 00036 #include <ros/ros.h> 00037 #include <std_msgs/String.h> 00038 #include <visualization_msgs/Marker.h> 00039 #include <geometry_msgs/Point.h> 00040 #include <vector> 00041 #include <algorithm> 00042 #include <math.h> 00043 #include <string> 00044 #include <sstream> 00045 #include <iostream> 00046 #include <cmath> 00047 00048 #include <sys/types.h> 00049 #include <unistd.h> 00050 #include <stdlib.h> 00051 #include <stdio.h> 00052 #include <numeric> 00053 #include <iterator> 00054 #include <phantom_control/State.h> 00055 #include <phantom_filter/Phantom.h> 00056 using geometry_msgs::Point; 00057 using namespace std; 00058 00059 vector<Point> Sqrt(vector<Point>); 00060 vector<Point> CumSum(vector<Point>); 00061 vector<Point> Round(vector<Point>,double); 00062 vector<Point> Atan2(vector<Point>); 00063 Point Mean(const vector<Point>&); 00064 vector<Point> BThresh(vector<Point>,double); 00065 void ProcessPoints(vector<Point>); 00066 vector<Point> Insert(vector<Point>,vector<Point>,vector<Point>,double); 00067 vector<Point> Moving_Average(vector<Point>,int); 00068 void ProcessPoints(vector<Point>); 00069 vector<Point> Diff(vector<Point>); 00070 void Drawlines(Point,Point,Point,Point); 00071 vector<Point> Copy(vector<Point> V,uint,int); 00072 void ProcessRot(); 00073 bool Limits(Point); 00074 Point Std(const vector<Point>&); 00075 void Velocity(vector<Point>,Point);