TestCalculus.cpp
Go to the documentation of this file.
00001 /*
00002  * TestCalculus.cpp
00003  *
00004  *  Created on: Sep 8, 2012
00005  *      Author: mriedel
00006  */
00007 
00008 
00009 #include <telekyb_calculus/Potentials/CoTanPotentialFunctions.hpp>
00010 
00011 #include <telekyb_base/TeleKyb.hpp>
00012 
00013 #include <telekyb_base/Options/RawOptionsContainer.hpp>
00014 
00015 using namespace telekyb;
00016 
00017 #define LOWER_BOUND 1.0
00018 #define UPPER_BOUND 7.0
00019 
00020 int main(int argc, char **argv) {
00021         TeleKyb::init(argc,argv,"TestCalculus");
00022 
00023         telekyb::RawOptionsContainer::addOption("RepGradient/tPotFuncZeroD","3");
00024         telekyb::RawOptionsContainer::addOption("RepGradient/tPotFuncInfD","5");
00025         telekyb::RawOptionsContainer::addOption("RepGradient/tPotFuncSatValue","100");
00026         telekyb::RawOptionsContainer::addOption("RepGradient/tPotFuncGain","1");
00027 
00028         CoTanRepulsiveGradient funcRep("RepGradient");
00029         CoTanAttractiveGradient funcAttr("AttrGradient", 2,6,10,1);
00030 
00031 //      PotentialFunction<PotentialFunctionImpl::CoTanRepulsiveGradient> testGradient("testGradient",
00032 //                      6, 2, 10, 1);
00033 
00034 //      PotentialFunction<PotentialFunctionImpl::CoTanRepulsiveHassian> testHassian("testHassian",
00035 //                      6, 2, 10, 1);
00036 
00037         double d = LOWER_BOUND;
00038         while(ros::ok()) {
00039 
00040                 ROS_INFO("Value: %f, RepGradient: %f",d, funcRep.getPotential(d));
00041                 ROS_INFO("Value: %f, AttGradient: %f",d, funcAttr.getPotential(d));
00042 
00043                 d += 0.1;
00044                 if (d > UPPER_BOUND) {
00045                         d = LOWER_BOUND;
00046                 }
00047 
00048                 usleep(1000*100);
00049         }
00050 
00051 
00052         TeleKyb::shutdown();
00053         return 0;
00054 }
00055 
00056 //const std::string& potentialFunctionName_,
00057 //                      PotentialFunctionType type,
00058 //                      double zeroDistance,
00059 //                      double infDistance,
00060 //                      double satValue,
00061 //                      double funcGain
00062 
00063 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Defines


telekyb_calculus
Author(s): Martin Riedel
autogenerated on Mon Nov 11 2013 11:13:18