spline_functions.h
Go to the documentation of this file.
00001 /*
00002  * UOS-ROS packages - Robot Operating System code by the University of Osnabrück
00003  * Copyright (C) 2010  University of Osnabrück
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018  *
00019  * spline_functions.h
00020  *
00021  *  Created on: 20.12.2010
00022  *      Author: Martin Günther <mguenthe@uos.de>
00023  */
00024 
00025 #ifndef SPLINE_FUNCTIONS_H_
00026 #define SPLINE_FUNCTIONS_H_
00027 
00028 #include <boost/numeric/ublas/lu.hpp>
00029 
00030 namespace katana
00031 {
00032 // These functions are pulled from the spline_smoother package.
00033 // They've been moved here to avoid depending on packages that aren't
00034 // mature yet.
00035 inline void generatePowers(int n, double x, double* powers);
00036 
00040 void sampleCubicSpline(const std::vector<double>& coefficients, double time, double& position, double& velocity,
00041                        double& acceleration);
00042 
00043 void getCubicSplineCoefficients(double start_pos, double start_vel, double end_pos, double end_vel, double time,
00044                                 std::vector<double>& coefficients);
00045 
00065 void splineCoefficients(int steps, double *timearray, double *encoderarray, double *arr_p1, double *arr_p2,
00066                         double *arr_p3, double *arr_p4);
00067 
00073 void sampleSplineWithTimeBounds(const std::vector<double>& coefficients, double duration, double time,
00074                                 double& position, double& velocity, double& acceleration);
00075 
00076 } // namespace katana
00077 
00078 #endif /* SPLINE_FUNCTIONS_H_ */


katana
Author(s): Martin Günther
autogenerated on Thu Aug 27 2015 13:40:35