Commit b4829c9f authored by oscar's avatar oscar

提交时间打印

parent 1b3abdf6
......@@ -212,7 +212,7 @@ void EventsRos::SendRosEvents(TrkObjsPtr& outs)
}
if (1/*iter.roadId != 0*/)
{
SDK_IDX_LOG(1, SDK_INFO, "%d,%llu,%lld,%s,%.10f,%.10f,%f,%f,%d,%d,%d,%d,%f,%d,%d,%d,%d,%d,%d",
SDK_IDX_LOG(1, SDK_INFO, "%s,%d,%llu,%lld,%s,%.10f,%.10f,%f,%f,%d,%d,%d,%d,%f,%d,%d,%d,%d,%d,%d", GetTimeStr(msg.time).c_str(),
iter.frameNum,iter.time,iter.id,iter.name.c_str(),iter.lat,iter.lon,iter.heading,iter.speed,iter.roadId,iter.laneCnt,iter.laneNum,iter.laneType,iter.laneAngle,
iter.eventList.size() > 0 ? iter.eventList[0].eventId : 0, iter.eventList.size() > 0 ? iter.eventList[0].eventType : 0, iter.eventList.size() > 0 ? iter.eventList[0].eventStatus : 0,
iter.eventList.size() > 1 ? iter.eventList[1].eventId : 0, iter.eventList.size() > 1 ? iter.eventList[1].eventType : 0, iter.eventList.size() > 1 ? iter.eventList[1].eventStatus : 0
......
......@@ -12,6 +12,20 @@ uint64_t GetCurTime()
return ttt;
}
std::string GetTimeStr(uint64_t timestamp)
{
time_t tt = timestamp;
struct tm* ptr;
ptr = localtime(&tt);
// printf("time: %d \n", tt);
char str[80];
strftime(str, sizeof(str), "%Y-%m-%d_%H:%M:%S", ptr);
//2018-09-19 16:01:37.517
std::string timeStr = str;
return timeStr;
}
// {
// person: person, # 行人
// bicycle: motorbike, # 自行车
......
......@@ -6,6 +6,8 @@
uint64_t GetCurTime();
std::string GetTimeStr(uint64_t timestamp);
const std::string& GetRootDir();
bool CheckCarLane(jf::LaneType laneType);//检查除了路口之外的道路类型
......
......@@ -188,7 +188,7 @@ int main(int argc, char** argv)
ADD_DEF_LOG(1, save_file.c_str());
if (save_file != "")
{
SDK_IDX_LOG(1, SDK_INFO, "frameNum,time,id,name,lat,lon,heading,speed,roadId,laneCnt,laneNum,laneType,laneAngle,event0_id,event0_type,event0_status,event1_id,event1_type,event1_status");
SDK_IDX_LOG(1, SDK_INFO, "time,frameNum,time,id,name,lat,lon,heading,speed,roadId,laneCnt,laneNum,laneType,laneAngle,event0_id,event0_type,event0_status,event1_id,event1_type,event1_status");
}
jfx_ros.Start();
......
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