Trajectory.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) Jürgen Riegel          (juergen.riegel@web.de) 2009     *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #ifndef ROBOT_Trajectory_H
00025 #define ROBOT_Trajectory_H
00026 
00027 #include "kdl_cp/trajectory.hpp"
00028 
00029 #include "Waypoint.h"
00030 
00031 #include <Base/Persistence.h>
00032 #include <Base/Placement.h>
00033 
00034 #include <vector>
00035 
00036 namespace KDL {class Trajectory_Composite;}
00037 
00038 namespace Robot
00039 {
00040 
00041 
00044 class RobotExport Trajectory : public Base::Persistence
00045 {
00046     TYPESYSTEM_HEADER();
00047 
00048 public:
00049     Trajectory();
00050     Trajectory(const Trajectory&);
00051     ~Trajectory();
00052 
00053     Trajectory &operator=(const Trajectory&);
00054 
00055         // from base class
00056     virtual unsigned int getMemSize (void) const;
00057         virtual void Save (Base::Writer &/*writer*/) const;
00058     virtual void Restore(Base::XMLReader &/*reader*/);
00059 
00060         // interface
00061     void generateTrajectory(void);
00062     void addWaypoint(const Waypoint &WPnt);
00063     unsigned int getSize(void) const{return vpcWaypoints.size();}
00064     const Waypoint &getWaypoint(unsigned int pos)const {return *vpcWaypoints[pos];}
00065     std::string getUniqueWaypointName(const char *Name) const;
00066     const std::vector<Waypoint*> &getWaypoints(void)const{return vpcWaypoints;}
00067 
00069     void deleteLast(unsigned int n=1);
00071     double getLength(int n=-1) const;
00073     double getDuration (int n=-1) const;
00074     Base::Placement getPosition(double time)const;
00075     double getVelocity(double time)const;
00076 
00077 
00078 protected:
00079 
00080     std::vector<Waypoint*> vpcWaypoints;
00081 
00082     KDL::Trajectory_Composite *pcTrajectory;
00083 };
00084 
00085 } //namespace Part
00086 
00087 
00088 #endif // PART_TOPOSHAPE_H

Generated on Wed Nov 23 19:00:49 2011 for FreeCAD by  doxygen 1.6.1