// printf("swtime> %lf\n", time);
- Pos h1, h2;
+/* Pos h1, h2;
for (iterator seg = begin(); seg != end(); ++seg) {
(*seg)->getRefPos((*seg)->getT1(), h1);
(*seg)->getRefPos((*seg)->getT2(), h2);
-// printf("puvodni %lf %lf %lf %lf", h1.x, h1.y, h2.x, h2.y);
-// printf(" -- times: %lf %lf\n", (*seg)->getT1(), (*seg)->getT2());
+ printf("puvodni %lf %lf %lf %lf", h1.x, h1.y, h2.x, h2.y);
+ printf(" -- times: %lf %lf\n", (*seg)->getT1(), (*seg)->getT2());
}
for (iterator seg = traj.begin(); seg != traj.end(); ++seg) {
(*seg)->getRefPos((*seg)->getT1(), h1);
(*seg)->getRefPos((*seg)->getT2(), h2);
-// printf("novy %lf %lf %lf %lf", h1.x, h1.y, h2.x, h2.y);
-// printf(" -- times: %lf %lf\n", (*seg)->getT1(), (*seg)->getT2());
+ printf("novy %lf %lf %lf %lf", h1.x, h1.y, h2.x, h2.y);
+ printf(" -- times: %lf %lf\n", (*seg)->getT1(), (*seg)->getT2());
}
-
+*/
// split & delete
for (iterator seg = begin(); seg != end(); ++seg) {
if ((*seg)->containsTime(time) == 0) {
for (iterator seg = begin(); seg != end(); ++seg) {
t = (*seg)->startAt(t);
}
-
+/*
for (iterator seg = begin(); seg != end(); ++seg) {
(*seg)->getRefPos((*seg)->getT1(), h1);
(*seg)->getRefPos((*seg)->getT2(), h2);
-// printf("merged %lf %lf %lf %lf", h1.x, h1.y, h2.x, h2.y);
-// printf(" -- times: %lf %lf\n", (*seg)->getT1(), (*seg)->getT2());
+ printf("merged %lf %lf %lf %lf", h1.x, h1.y, h2.x, h2.y);
+ printf(" -- times: %lf %lf\n", (*seg)->getT1(), (*seg)->getT2());
}
-
+*/
+ currentSeg = begin();
prepared = true;
return true;
}
{
pthread_mutex_lock(&actual_trajectory_lock);
Trajectory *old;
- old = actual_trajectory;
if (append_time != 0) {
// trajectory only connects a new one in some specific time
if(!actual_trajectory->appendTrajectory(*t, append_time))
DBG("Can not append trajectory\n");
} else {
// trajectory starts from zero time
+ old = actual_trajectory;
gettimeofday(&tv_start, NULL);
actual_trajectory = t;
+ if (old)
+ delete(old);
}
pthread_mutex_unlock(&actual_trajectory_lock);
- if (old)
- delete(old);
-
}
/**