Trajectory.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00056 virtual unsigned int getMemSize (void) const;
00057 virtual void Save (Base::Writer &) const;
00058 virtual void Restore(Base::XMLReader &);
00059
00060
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 }
00086
00087
00088 #endif // PART_TOPOSHAPE_H