extended txt format. related to #310

parent eaa79064
Pipeline #19136 failed with stages
in 14 seconds
......@@ -345,7 +345,8 @@ void TrajectoriesFLAT::WriteHeader(long nPeds, double fps, Building* building, i
Write("#FR: the current frame");
Write("#X,Y,Z: the agents coordinates (in metres)");
//Write("#ID\tFR\tX\tY\tZ");// @todo: maybe use two different formats
Write("#ID\tFR\tX\tY\tZ\tA\tB\tANGLE\tCOLOR");// a b angle color
void TrajectoriesFLAT::WriteGeometry(Building* building)
......@@ -362,7 +363,14 @@ void TrajectoriesFLAT::WriteFrame(int frameNr, Building* building)
double x = ped->GetPos()._x;
double y = ped->GetPos()._y;
double z = ped->GetElevation();
sprintf(tmp, "%d\t%d\t%0.2f\t%0.2f\t%0.2f", ped->GetID(), frameNr, x, y,z);
int color=ped->GetColor();
double a = ped->GetLargerAxis();
double b = ped->GetSmallerAxis();
double phi = atan2(ped->GetEllipse().GetSinPhi(), ped->GetEllipse().GetCosPhi());
double RAD2DEG = 180.0 / M_PI;
// @todo: maybe two different formats
//sprintf(tmp, "%d\t%d\t%0.2f\t%0.2f\t%0.2f", ped->GetID(), frameNr, x, y, z);
sprintf(tmp, "%d\t%d\t%0.2f\t%0.2f\t%0.2f\t%0.2f\t%0.2f\t%0.2f\t%d", ped->GetID(), frameNr, x, y, z, a, b, phi * RAD2DEG, color);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment