Commit 624062aa authored by Gregor Jaeger's avatar Gregor Jaeger

initial commit issue 107 - WIP

parent 54568d8e
Pipeline #20399 passed with stages
in 34 seconds
......@@ -189,7 +189,7 @@ bool Method_I::Process(const PedData& peddata,const fs::path& scriptsLocation, c
if(!_isOneDimensional)
{
// GetIndividualFD(polygons,VInFrame, IdInFrame, str_frid); // TODO polygons_id
GetIndividualFD(polygons,VInFrame, IdInFrame, str_frid, XInFrame, YInFrame); //
GetIndividualFD(polygons,VInFrame, IdInFrame, str_frid, XInFrame, YInFrame, zPos_measureArea); //
  • z of the measurement area or z or the pedestrian?

    There is a function PedData::GetZInFrame(). Maybe you want to use this instead.

    Edited by Mohcine Chraibi
  • We should take the z-position from the trajectory file. So we should use the PedData::GetZInFrame().

Please register or sign in to reply
}
}
if(_getProfile)
......@@ -266,7 +266,7 @@ bool Method_I::Process(const PedData& peddata,const fs::path& scriptsLocation, c
}
else
{
fprintf(_fIndividualFD,"#framerate (fps):\t%.2f\n\n#Frame \t PersID \t x/m \t y/m \t Individual density(m^(-2)) \t Individual velocity(m/s) \t Voronoi Polygon\n",_fps);
fprintf(_fIndividualFD,"#framerate (fps):\t%.2f\n\n#Frame \t PersID \t x/m \t y/m \t z/m \t Individual density(m^(-2)) \t Individual velocity(m/s) \t Voronoi Polygon\n",_fps);
}
return true;
}
......@@ -547,11 +547,11 @@ bool Method_I::Process(const PedData& peddata,const fs::path& scriptsLocation, c
}
}
void Method_I::GetIndividualFD(const vector<polygon_2d>& polygon, const vector<double>& Velocity, const vector<int>& Id, const string& frid, vector<double>& XInFrame, vector<double>& YInFrame)
void Method_I::GetIndividualFD(const vector<polygon_2d>& polygon, const vector<double>& Velocity, const vector<int>& Id, const string& frid, vector<double>& XInFrame, vector<double>& YInFrame, double ZInFrame)
{
double uniquedensity=0;
double uniquevelocity=0;
double x, y;
double x, y, z;
int uniqueId=0;
int temp=0;
for (const auto & polygon_iterator:polygon)
......@@ -562,11 +562,13 @@ void Method_I::GetIndividualFD(const vector<polygon_2d>& polygon, const vector<d
uniqueId=Id[temp];
x = XInFrame[temp]*CMtoM;
y = YInFrame[temp]*CMtoM;
fprintf(_fIndividualFD,"%s\t %d\t %.4f\t %.4f\t %.4f\t %.4f\t %s\n",
z = ZInFrame*CMtoM;
fprintf(_fIndividualFD,"%s\t %d\t %.4f\t %.4f\t %.4f\t %.4f\t %.4f\t %s\n",
frid.c_str(),
uniqueId,
x,
y,
z,
uniquedensity,
uniquevelocity,
polygon_str.c_str()
......
......@@ -104,7 +104,7 @@ private:
void GetProfiles(const std::string& frameId, const std::vector<polygon_2d>& polygons, const std::vector<double>& velocity);
void OutputVoroGraph(const std::string & frameId, std::vector<std::pair<polygon_2d, int> >& polygons, int numPedsInFrame,const std::vector<double>& VInFrame);
void GetIndividualFD(const std::vector<polygon_2d>& polygon, const std::vector<double>& Velocity, const std::vector<int>& Id, const std::string& frid);
void GetIndividualFD(const std::vector<polygon_2d>& polygon, const std::vector<double>& Velocity, const std::vector<int>& Id, const std::string& frid, std::vector<double>& XInFrame, std::vector<double>& YInFrame);
void GetIndividualFD(const std::vector<polygon_2d>& polygon, const std::vector<double>& Velocity, const std::vector<int>& Id, const std::string& frid, std::vector<double>& XInFrame, std::vector<double>& YInFrame, double ZInFrame);
/**
* Reduce the precision of the points to two digits
* @param polygon
......
......@@ -430,7 +430,7 @@ bool PedData::InitializeVariables(TiXmlElement* xRootNode)
for(TiXmlElement* xAgent = xFrame->FirstChildElement("agent"); xAgent;
xAgent = xAgent->NextSiblingElement("agent"))
{
//get agent id, x, y
//get agent id, x, y, z
double x= atof(xAgent->Attribute("x"));
double y= atof(xAgent->Attribute("y"));
double z= atof(xAgent->Attribute("z"));
......
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