taylor_model.h
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2011, Willow Garage, Inc.
00005  *  All rights reserved.
00006  *
00007  *  Redistribution and use in source and binary forms, with or without
00008  *  modification, are permitted provided that the following conditions
00009  *  are met:
00010  *
00011  *   * Redistributions of source code must retain the above copyright
00012  *     notice, this list of conditions and the following disclaimer.
00013  *   * Redistributions in binary form must reproduce the above
00014  *     copyright notice, this list of conditions and the following
00015  *     disclaimer in the documentation and/or other materials provided
00016  *     with the distribution.
00017  *   * Neither the name of Willow Garage, Inc. nor the names of its
00018  *     contributors may be used to endorse or promote products derived
00019  *     from this software without specific prior written permission.
00020  *
00021  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00025  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00028  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00029  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00031  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00032  *  POSSIBILITY OF SUCH DAMAGE.
00033  */
00034 
00037 #ifndef FCL_CCD_TAYLOR_MODEL_H
00038 #define FCL_CCD_TAYLOR_MODEL_H
00039 
00040 #include "fcl/ccd/interval.h"
00041 #include <boost/shared_ptr.hpp>
00042 
00043 namespace fcl
00044 {
00045 
00046 struct TimeInterval
00047 {
00049   Interval t_; // [t1, t2]
00050   Interval t2_; // [t1, t2]^2
00051   Interval t3_; // [t1, t2]^3
00052   Interval t4_; // [t1, t2]^4
00053   Interval t5_; // [t1, t2]^5
00054   Interval t6_; // [t1, t2]^6
00055 };
00056 
00060 struct TaylorModel
00061 {
00063   boost::shared_ptr<TimeInterval> time_interval_;
00064 
00066   FCL_REAL coeffs_[4];
00067 
00069   Interval r_;
00070 
00071   void setTimeInterval(FCL_REAL l, FCL_REAL r);
00072   void setTimeInterval(const boost::shared_ptr<TimeInterval> time_interval)
00073   {
00074     time_interval_ = time_interval;
00075   }
00076 
00077   TaylorModel();
00078   TaylorModel(const boost::shared_ptr<TimeInterval>& time_interval);
00079   TaylorModel(FCL_REAL coeff, const boost::shared_ptr<TimeInterval>& time_interval);
00080   TaylorModel(FCL_REAL coeffs[3], const Interval& r, const boost::shared_ptr<TimeInterval>& time_interval);
00081   TaylorModel(FCL_REAL c0, FCL_REAL c1, FCL_REAL c2, FCL_REAL c3, const Interval& r, const boost::shared_ptr<TimeInterval>& time_interval);
00082 
00083   TaylorModel operator + (const TaylorModel& other) const;
00084   TaylorModel& operator += (const TaylorModel& other);
00085 
00086   TaylorModel operator - (const TaylorModel& other) const;
00087   TaylorModel& operator -= (const TaylorModel& other);
00088 
00089   TaylorModel operator + (FCL_REAL d) const;
00090   TaylorModel& operator += (FCL_REAL d);
00091 
00092   TaylorModel operator * (const TaylorModel& other) const;
00093   TaylorModel operator * (FCL_REAL d) const;
00094   TaylorModel& operator *= (const TaylorModel& other);
00095   TaylorModel& operator *= (FCL_REAL d);
00096 
00097   TaylorModel operator - () const;
00098 
00099   void print() const;
00100 
00101   Interval getBound() const;
00102   Interval getBound(FCL_REAL l, FCL_REAL r) const;
00103 
00104   Interval getTightBound() const;
00105   Interval getTightBound(FCL_REAL l, FCL_REAL r) const;
00106 
00107   Interval getBound(FCL_REAL t) const;
00108 
00109   void setZero();
00110 };
00111 
00112 void generateTaylorModelForCosFunc(TaylorModel& tm, FCL_REAL w, FCL_REAL q0);
00113 void generateTaylorModelForSinFunc(TaylorModel& tm, FCL_REAL w, FCL_REAL q0);
00114 void generateTaylorModelForLinearFunc(TaylorModel& tm, FCL_REAL p, FCL_REAL v);
00115 
00116 }
00117 
00118 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


fcl
Author(s): Jia Pan
autogenerated on Tue Jan 15 2013 16:05:30