8 #ifndef TRAJECTORY_HPP_
9 #define TRAJECTORY_HPP_
11 #include "API/Device/robot.hpp"
12 #include "API/ConfigSpace/configuration.hpp"
13 #include "API/ConfigSpace/localpath.hpp"
54 bool operator == (
const Trajectory& t )
const;
55 bool operator != (
const Trajectory& t )
const;
59 void copyPaths( std::vector<LocalPath*>& vect );
61 std::vector< std::tr1::shared_ptr<Configuration> > getTowConfigurationAtParam(
double param1,
double param2,
62 uint& lp1, uint& lp2 );
64 std::pair<bool,std::vector<LocalPath*> > extractSubPortion(
double param1,
double param2,
unsigned int& first,
unsigned int& last,
bool check_for_coll =
true);
66 Trajectory extractSubTrajectory(
double param1,
double param2,
bool check_for_coll =
true);
70 bool replacePortionOfLocalPaths(
unsigned int id1,
unsigned int id2,std::vector<LocalPath*> paths,
bool freeMemory =
true );
71 bool replacePortion(
double param1,
double param2,std::vector<LocalPath*> paths ,
bool freeMemory =
true );
73 bool replaceBegin(
double param,
const std::vector<LocalPath*>& paths );
74 bool replaceEnd(
double param,
const std::vector<LocalPath*>& paths );
76 bool cutTrajInSmallLP(
unsigned int nLP);
77 bool cutTrajInSmallLPSimple(
unsigned int nLP);
78 uint cutPortionInSmallLP(std::vector<LocalPath*>& portion, uint nLP);
80 void push_back(confPtr_t q);
81 bool push_back(std::tr1::shared_ptr<LocalPath> path);
85 double collisionCost();
87 std::vector< std::pair<double,double > > getCostProfile();
88 double computeSubPortionIntergralCost(std::vector<LocalPath*>& portion);
89 double computeSubPortionCost(std::vector<LocalPath*>& portion);
90 double computeSubPortionCost(std::vector<LocalPath*>::iterator first, std::vector<LocalPath*>::iterator last);
91 double computeSubPortionMaxCost(std::vector<LocalPath*>& portion);
92 double ReComputeSubPortionCost(std::vector<LocalPath*>& portion,
int& nb_cost_tests);
93 double computeSubPortionCostVisib( std::vector<LocalPath*>& portion );
94 double costOfPortion(
double param1,
double param2);
95 double extractCostPortion(
double param1,
double param2);
98 double computeCostComplete();
99 double costComplete();
100 double costNoRecompute();
101 double costRecomputed();
103 double costDeltaAlongTraj();
104 double costNPoints(
const int n_points);
107 std::vector<double> getCostAlongTrajectory(
int nbSample);
108 void resetCostComputed();
116 confPtr_t operator [] (
const int &i )
const;
117 confPtr_t configAtParam(
double param,
unsigned int* id_localpath=NULL)
const;
118 double paramAtConfig(confPtr_t config,
double step = -1)
const;
119 LocalPath* getLocalPathPtrOf(confPtr_t conf)
const;
120 double distanceToTraj(confPtr_t config,
double step = -1);
122 std::vector<confPtr_t> getNConfAtParam(
double delta);
123 std::vector<confPtr_t> getVectorOfConfiguration();
125 uint getIdOfPathAt(
double param);
126 LocalPath* getLocalPathPtrAt(
unsigned int id)
const;
127 int getNbOfPaths()
const;
128 int getNbOfViaPoints()
const;
134 double computeSubPortionRange(
const std::vector<LocalPath*>& portion)
const;
136 bool replaceP3dTraj();
137 p3d_traj* replaceP3dTraj(p3d_traj* trajPt);
138 p3d_traj* replaceHumanP3dTraj(
Robot*rob, p3d_traj* trajPt);
140 void printAllLocalpathCost();
141 void draw(
int nbKeyFrame);
148 bool makeBSplineTrajectory();
154 void setColor(
int col) {mColor=col;}
156 unsigned int getHighestCostId()
const
158 return HighestCostId;
161 Robot* getRobot()
const
168 return m_Courbe.size();
171 confPtr_t getBegin()
const
176 confPtr_t getEnd()
const
181 std::vector<LocalPath*> getCourbe()
const
185 std::vector<LocalPath*> &getCourbe()
190 double getRangeMax()
const {
191 return computeSubPortionRange(m_Courbe);
200 unsigned int HighestCostId;
201 bool isHighestCostIdSet;
204 std::vector<LocalPath*> m_Courbe;
222 namespace API {
class Trajectory; }
223 extern std::vector<API::Trajectory> trajToDraw;
224 void draw_traj_debug();
Definition: trajectory.hpp:23
Classe représentant un chemin local.
Definition: localpath.hpp:15
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
Definition: trajectory.hpp:40
Trajectory extractSubTrajectoryOfLocalPaths(unsigned int id_start, unsigned int id_end)
Extract sub trajectory.
Definition: trajectory.cpp:1560