#include "trgendbg.h"
#include <string.h>
-//#define MOTION_LOG
// #ifdef MATLAB_MEX_FILE
// #define S_FUNCTION_LEVEL 2
if ((*p1)->distanceTo(**p2) < 0.001) {
#ifdef MOTION_LOG
char ccc[150];
- sprintf(ccc, "One of identical points x %lf y %lf erased\n", (*p2)->x, (*p2)->y);
+ sprintf(ccc, "#One of identical points x %lf y %lf erased\n", (*p2)->x, (*p2)->y);
log(ccc);
#endif
p2 = wayPoints.erase(p2);
wayPoints.insert(p2, pt);
#ifdef MOTION_LOG
char ccc[150];
- sprintf(ccc, "Sharp edge smoothed %lf %lf, %lf %lf, %lf %lf\n",
+ sprintf(ccc, "#Sharp edge smoothed %lf %lf, %lf %lf, %lf %lf\n",
(**p1).x, (**p1).y, (**p2).x, (**p2).y, (**p3).x, (**p3).y);
log(ccc);
#endif
#ifdef MOTION_LOG
char c[200];
for (p1 = wayPoints.begin(); p1 != wayPoints.end(); p1++) {
- sprintf(c, "wayPoints: x %lf y %lf\n", (*p1)->x, (*p1)->y);
+ sprintf(c, "#wayPoints: x %lf y %lf\n", (*p1)->x, (*p1)->y);
log(c);
}
#endif
segPrev = insert(segNext, new Spline(newEnd1, newEnd2, edge));
#ifdef MOTION_LOG
char c[200];
- sprintf(c, "splineToBeCounted: begin %lf %lf end %lf %lf edge %lf %lf\n",
+ sprintf(c, "#splineToBeCounted: begin %lf %lf end %lf %lf edge %lf %lf\n",
newEnd1->x, newEnd1->y, newEnd2->x, newEnd2->y, edge->x, edge->y);
log(c);
#endif
TrajectoryPoints::iterator p1;
char c[200];
for (p1 = wayPoints.begin(); p1 != wayPoints.end(); p1++) {
- sprintf(c, "wayPointsSplined: x %lf y %lf\n", (*p1)->x, (*p1)->y);
+ sprintf(c, "#wayPointsSplined: x %lf y %lf\n", (*p1)->x, (*p1)->y);
log(c);
}
#endif
seg = *currentSeg;
#ifdef MOTION_LOG
char c[100];
- sprintf(c, "slength %lf\n", seg->getLength()); // gnuplot middle part
+ sprintf(c, "#slength %lf\n", seg->getLength()); // gnuplot middle part
log(c);
#endif
if (d==0)
// printf("-difference real %lf %lf\n", p.x, p.y);
#ifdef MOTION_LOG
- log("trajectory APPENDED (merged two trajectories togeather)\n");
+ log("#trajectory APPENDED (merged two trajectories togeather)\n");
char c[200];
Pos p1, p2;
for (iterator seg = begin(); seg != end(); seg++) { // logging segment parameters
(*seg)->getRefPos((*seg)->getT1(), p1);
(*seg)->getRefPos((*seg)->getT2(), p2);
- sprintf(c, "segment: begin %lf %lf, end %lf %lf, angles %lf %lf, v1 %lf, v2 %lf, t1 %lf, t2 %lf, len %lf\n",
+ sprintf(c, "#segment: begin %lf %lf, end %lf %lf, angles %lf %lf, v1 %lf, v2 %lf, t1 %lf, t2 %lf, len %lf\n",
p1.x, p1.y, p2.x, p2.y, p1.phi, p2.phi,(*seg)->v1, (*seg)->v2, (*seg)->getT1(), (*seg)->getT2(), (*seg)->getLength());
log(c);
}
for (iterator seg = begin(); seg != end(); seg++) { // logging segment parameters
(*seg)->getRefPos((*seg)->getT1(), p1);
(*seg)->getRefPos((*seg)->getT2(), p2);
- sprintf(c, "segment: begin %lf %lf, end %lf %lf, angles %lf %lf, v1 %lf, v2 %lf, t1 %lf, t2 %lf, len %lf\n",
+ sprintf(c, "#segment: begin %lf %lf, end %lf %lf, angles %lf %lf, v1 %lf, v2 %lf, t1 %lf, t2 %lf, len %lf\n",
p1.x, p1.y, p2.x, p2.y, p1.phi, p2.phi,(*seg)->v1, (*seg)->v2, (*seg)->getT1(), (*seg)->getT2(), (*seg)->getLength());
log(c);
sprintf(c, "gnuplot: %lf %lf %lf %lf %d\n", start_time+(*seg)->getT1(), p1.x, p1.y, p1.phi, 1); //gnuplot start point