|
@@ -144,7 +144,7 @@ void DataCluster::UpdateGPSIMU(const char * strdata,const unsigned int nSize,con
|
|
data->vel_E = xgpsimu.ve(); //东向速度,单位(米/秒)
|
|
data->vel_E = xgpsimu.ve(); //东向速度,单位(米/秒)
|
|
data->vel_N = xgpsimu.vn(); //北向速度,单位(米/秒)
|
|
data->vel_N = xgpsimu.vn(); //北向速度,单位(米/秒)
|
|
GaussProjCal(data->gps_lng,data->gps_lat,&data->gps_x,&data->gps_y);
|
|
GaussProjCal(data->gps_lng,data->gps_lat,&data->gps_x,&data->gps_y);
|
|
-// qDebug()<<data->gps_x<<data->gps_y;
|
|
|
|
|
|
+ // qDebug()<<data->gps_x<<data->gps_y;
|
|
ServiceCarStatus.mRTKStatus = data->rtk_status;
|
|
ServiceCarStatus.mRTKStatus = data->rtk_status;
|
|
ServiceCarStatus.speed = data->speed;
|
|
ServiceCarStatus.speed = data->speed;
|
|
ServiceCarStatus.location->gps_lat = data->gps_lat;
|
|
ServiceCarStatus.location->gps_lat = data->gps_lat;
|
|
@@ -616,89 +616,91 @@ QJsonObject DataCluster::fillPrimitivesTest()
|
|
std::vector<iv::TracePoint> xplan(m_plan_right);
|
|
std::vector<iv::TracePoint> xplan(m_plan_right);
|
|
mMutexPlanRight.unlock();
|
|
mMutexPlanRight.unlock();
|
|
size = xplan.size();
|
|
size = xplan.size();
|
|
- for(int i = 0; i < 300; i++)
|
|
|
|
|
|
+ if(size)
|
|
{
|
|
{
|
|
- QJsonArray arrVerticesEle;
|
|
|
|
- arrVerticesEle.insert(0,QJsonValue(xplan.at(i).y));
|
|
|
|
- arrVerticesEle.insert(1,QJsonValue(-xplan.at(i).x));
|
|
|
|
- arrVerticesEle.insert(2,QJsonValue(0));
|
|
|
|
- arrVertices.insert(i,QJsonValue(arrVerticesEle));
|
|
|
|
- }
|
|
|
|
- objVertices.insert("vertices",QJsonValue(arrVertices));
|
|
|
|
- arrPolylinesk.insert(0,QJsonValue(objVertices));
|
|
|
|
- objTrajectory.insert("polylines",QJsonValue(arrPolylinesk));
|
|
|
|
|
|
+ for(int i = 0; i < 300; i++)
|
|
|
|
+ {
|
|
|
|
+ QJsonArray arrVerticesEle;
|
|
|
|
+ arrVerticesEle.insert(0,QJsonValue(xplan.at(i).y));
|
|
|
|
+ arrVerticesEle.insert(1,QJsonValue(-xplan.at(i).x));
|
|
|
|
+ arrVerticesEle.insert(2,QJsonValue(0));
|
|
|
|
+ arrVertices.insert(i,QJsonValue(arrVerticesEle));
|
|
|
|
+ }
|
|
|
|
+ objVertices.insert("vertices",QJsonValue(arrVertices));
|
|
|
|
+ arrPolylinesk.insert(0,QJsonValue(objVertices));
|
|
|
|
+ objTrajectory.insert("polylines",QJsonValue(arrPolylinesk));
|
|
|
|
|
|
- //zhangaiwu
|
|
|
|
- QJsonObject objPloygons;
|
|
|
|
- QJsonArray arrPloygons;
|
|
|
|
|
|
+ //zhangaiwu
|
|
|
|
+ QJsonObject objPloygons;
|
|
|
|
+ QJsonArray arrPloygons;
|
|
|
|
+
|
|
|
|
+ QJsonArray arrVertices1,arrClass;
|
|
|
|
+ QJsonObject objBase,objStyle,objvertices;
|
|
|
|
+ QJsonArray arrVerticesElm1;
|
|
|
|
+ QJsonArray arrVerticesElm2;
|
|
|
|
+ QJsonArray arrVerticesElm3;
|
|
|
|
+ QJsonArray arrVerticesElm4;
|
|
|
|
+ QJsonArray arrVerticesElm5;
|
|
|
|
+ double x,y,x1,x2,x3,y1,y2,y3;
|
|
|
|
+ double r = -ServiceCarStatus.location->ins_heading_angle*PI/180;
|
|
|
|
+ x = xplan.at(100).x;
|
|
|
|
+ y = xplan.at(100).y;
|
|
|
|
+
|
|
|
|
+ x1 = x+2*cos(r);
|
|
|
|
+ y1 = y + 2*sin(r);
|
|
|
|
+ x2 = x-5*sin(r)+2*cos(r);
|
|
|
|
+ y2 = 2*sin(r)+y+5*cos(r);
|
|
|
|
+ x3 = x-5*sin(r);
|
|
|
|
+ y3 = y+5*cos(r);
|
|
|
|
+
|
|
|
|
+ // arrVerticesElm1.append(QJsonValue(xplan.at(100).y));
|
|
|
|
+ // arrVerticesElm1.append(QJsonValue(-xplan.at(100).x+0.8));
|
|
|
|
+ // arrVerticesElm1.append(QJsonValue(-1));
|
|
|
|
+ // arrVerticesElm2.append(QJsonValue(xplan.at(100).y));
|
|
|
|
+ // arrVerticesElm2.append(QJsonValue(-xplan.at(100).x-0.8));
|
|
|
|
+ // arrVerticesElm2.append(QJsonValue(-1));
|
|
|
|
+ // arrVerticesElm3.append(QJsonValue(xplan.at(130).y));
|
|
|
|
+ // arrVerticesElm3.append(QJsonValue(-xplan.at(100).x-0.8));
|
|
|
|
+ // arrVerticesElm3.append(QJsonValue(-1));
|
|
|
|
+ // arrVerticesElm4.append(QJsonValue(xplan.at(130).y));
|
|
|
|
+ // arrVerticesElm4.append(QJsonValue(-xplan.at(100).x+0.8));
|
|
|
|
+ // arrVerticesElm4.append(QJsonValue(-1));
|
|
|
|
+ // arrVerticesElm5.append(QJsonValue(xplan.at(100).y));
|
|
|
|
+ // arrVerticesElm5.append(QJsonValue(-xplan.at(100).x+0.8));
|
|
|
|
+ // arrVerticesElm5.append(QJsonValue(-1));
|
|
|
|
+ arrVerticesElm1.append(QJsonValue(y));
|
|
|
|
+ arrVerticesElm1.append(QJsonValue(-x));
|
|
|
|
+ arrVerticesElm1.append(QJsonValue(-1));
|
|
|
|
+ arrVerticesElm2.append(QJsonValue(y1));
|
|
|
|
+ arrVerticesElm2.append(QJsonValue(-x1));
|
|
|
|
+ arrVerticesElm2.append(QJsonValue(-1));
|
|
|
|
+ arrVerticesElm3.append(QJsonValue(y2));
|
|
|
|
+ arrVerticesElm3.append(QJsonValue(-x2));
|
|
|
|
+ arrVerticesElm3.append(QJsonValue(-1));
|
|
|
|
+ arrVerticesElm4.append(QJsonValue(y3));
|
|
|
|
+ arrVerticesElm4.append(QJsonValue(-x3));
|
|
|
|
+ arrVerticesElm4.append(QJsonValue(-1));
|
|
|
|
+ // arrVerticesElm5.append(QJsonValue(y));
|
|
|
|
+ // arrVerticesElm5.append(QJsonValue(-x));
|
|
|
|
+ // arrVerticesElm5.append(QJsonValue(-1));
|
|
|
|
+ arrVertices1.append(QJsonValue(arrVerticesElm1));
|
|
|
|
+ arrVertices1.append(QJsonValue(arrVerticesElm2));
|
|
|
|
+ arrVertices1.append(QJsonValue(arrVerticesElm3));
|
|
|
|
+ arrVertices1.append(QJsonValue(arrVerticesElm4));
|
|
|
|
+ // arrVertices1.append(QJsonValue(arrVerticesElm5));
|
|
|
|
+
|
|
|
|
+ objvertices.insert("vertices",QJsonValue(arrVertices1));
|
|
|
|
+ objBase.insert("object_id",QJsonValue(1));
|
|
|
|
+ objStyle.insert("height",QJsonValue(1));
|
|
|
|
+ objBase.insert("style",QJsonValue(objStyle));
|
|
|
|
+ arrClass.append(QJsonValue("Car"));//TODO:leixing
|
|
|
|
+ objBase.insert("classes",QJsonValue(arrClass));
|
|
|
|
+
|
|
|
|
+ objvertices.insert("base",QJsonValue(objBase));
|
|
|
|
|
|
- QJsonArray arrVertices1,arrClass;
|
|
|
|
- QJsonObject objBase,objStyle,objvertices;
|
|
|
|
- QJsonArray arrVerticesElm1;
|
|
|
|
- QJsonArray arrVerticesElm2;
|
|
|
|
- QJsonArray arrVerticesElm3;
|
|
|
|
- QJsonArray arrVerticesElm4;
|
|
|
|
- QJsonArray arrVerticesElm5;
|
|
|
|
- double x,y,x1,x2,x3,y1,y2,y3;
|
|
|
|
- double r = -ServiceCarStatus.location->ins_heading_angle*PI/180;
|
|
|
|
- x = xplan.at(100).x;
|
|
|
|
- y = xplan.at(100).y;
|
|
|
|
-
|
|
|
|
- x1 = x+2*cos(r);
|
|
|
|
- y1 = y + 2*sin(r);
|
|
|
|
- x2 = x-5*sin(r)+2*cos(r);
|
|
|
|
- y2 = 2*sin(r)+y+5*cos(r);
|
|
|
|
- x3 = x-5*sin(r);
|
|
|
|
- y3 = y+5*cos(r);
|
|
|
|
-
|
|
|
|
- // arrVerticesElm1.append(QJsonValue(xplan.at(100).y));
|
|
|
|
- // arrVerticesElm1.append(QJsonValue(-xplan.at(100).x+0.8));
|
|
|
|
- // arrVerticesElm1.append(QJsonValue(-1));
|
|
|
|
- // arrVerticesElm2.append(QJsonValue(xplan.at(100).y));
|
|
|
|
- // arrVerticesElm2.append(QJsonValue(-xplan.at(100).x-0.8));
|
|
|
|
- // arrVerticesElm2.append(QJsonValue(-1));
|
|
|
|
- // arrVerticesElm3.append(QJsonValue(xplan.at(130).y));
|
|
|
|
- // arrVerticesElm3.append(QJsonValue(-xplan.at(100).x-0.8));
|
|
|
|
- // arrVerticesElm3.append(QJsonValue(-1));
|
|
|
|
- // arrVerticesElm4.append(QJsonValue(xplan.at(130).y));
|
|
|
|
- // arrVerticesElm4.append(QJsonValue(-xplan.at(100).x+0.8));
|
|
|
|
- // arrVerticesElm4.append(QJsonValue(-1));
|
|
|
|
- // arrVerticesElm5.append(QJsonValue(xplan.at(100).y));
|
|
|
|
- // arrVerticesElm5.append(QJsonValue(-xplan.at(100).x+0.8));
|
|
|
|
- // arrVerticesElm5.append(QJsonValue(-1));
|
|
|
|
- arrVerticesElm1.append(QJsonValue(y));
|
|
|
|
- arrVerticesElm1.append(QJsonValue(-x));
|
|
|
|
- arrVerticesElm1.append(QJsonValue(-1));
|
|
|
|
- arrVerticesElm2.append(QJsonValue(y1));
|
|
|
|
- arrVerticesElm2.append(QJsonValue(-x1));
|
|
|
|
- arrVerticesElm2.append(QJsonValue(-1));
|
|
|
|
- arrVerticesElm3.append(QJsonValue(y2));
|
|
|
|
- arrVerticesElm3.append(QJsonValue(-x2));
|
|
|
|
- arrVerticesElm3.append(QJsonValue(-1));
|
|
|
|
- arrVerticesElm4.append(QJsonValue(y3));
|
|
|
|
- arrVerticesElm4.append(QJsonValue(-x3));
|
|
|
|
- arrVerticesElm4.append(QJsonValue(-1));
|
|
|
|
- // arrVerticesElm5.append(QJsonValue(y));
|
|
|
|
- // arrVerticesElm5.append(QJsonValue(-x));
|
|
|
|
- // arrVerticesElm5.append(QJsonValue(-1));
|
|
|
|
- arrVertices1.append(QJsonValue(arrVerticesElm1));
|
|
|
|
- arrVertices1.append(QJsonValue(arrVerticesElm2));
|
|
|
|
- arrVertices1.append(QJsonValue(arrVerticesElm3));
|
|
|
|
- arrVertices1.append(QJsonValue(arrVerticesElm4));
|
|
|
|
- // arrVertices1.append(QJsonValue(arrVerticesElm5));
|
|
|
|
-
|
|
|
|
- objvertices.insert("vertices",QJsonValue(arrVertices1));
|
|
|
|
- objBase.insert("object_id",QJsonValue(1));
|
|
|
|
- objStyle.insert("height",QJsonValue(1));
|
|
|
|
- objBase.insert("style",QJsonValue(objStyle));
|
|
|
|
- arrClass.append(QJsonValue("Car"));//TODO:leixing
|
|
|
|
- objBase.insert("classes",QJsonValue(arrClass));
|
|
|
|
-
|
|
|
|
- objvertices.insert("base",QJsonValue(objBase));
|
|
|
|
-
|
|
|
|
- arrPloygons.append(QJsonValue(objvertices));
|
|
|
|
|
|
+ arrPloygons.append(QJsonValue(objvertices));
|
|
|
|
|
|
- objPloygons.insert("polygons",QJsonValue(arrPloygons));
|
|
|
|
|
|
+ objPloygons.insert("polygons",QJsonValue(arrPloygons));
|
|
//tracking point
|
|
//tracking point
|
|
QJsonArray arrCircles;
|
|
QJsonArray arrCircles;
|
|
QJsonObject objCircles;
|
|
QJsonObject objCircles;
|
|
@@ -723,6 +725,7 @@ QJsonObject DataCluster::fillPrimitivesTest()
|
|
objPrimtives.insert("/tracklets/tracking_point",QJsonValue(objCircles));
|
|
objPrimtives.insert("/tracklets/tracking_point",QJsonValue(objCircles));
|
|
objPrimtives.insert("/tracklets/roadmap",QJsonValue(fillMapTrace()));
|
|
objPrimtives.insert("/tracklets/roadmap",QJsonValue(fillMapTrace()));
|
|
return objPrimtives;
|
|
return objPrimtives;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
QJsonObject DataCluster::fillMapTrace()
|
|
QJsonObject DataCluster::fillMapTrace()
|
|
{
|
|
{
|
|
@@ -855,11 +858,11 @@ QJsonObject DataCluster::fillFrame()
|
|
QJsonObject objData,objFrame;
|
|
QJsonObject objData,objFrame;
|
|
QJsonObject objposeData,objPriData,objUpdates;
|
|
QJsonObject objposeData,objPriData,objUpdates;
|
|
objposeData = fillPoseData();
|
|
objposeData = fillPoseData();
|
|
- objPriData = fillPrimitivesTest();
|
|
|
|
|
|
+// objPriData = fillPrimitivesTest();
|
|
arrTimeSeries = fillTimeSeries();
|
|
arrTimeSeries = fillTimeSeries();
|
|
objUpdates.insert("timestamp",QJsonValue(QDateTime::currentMSecsSinceEpoch()/100));
|
|
objUpdates.insert("timestamp",QJsonValue(QDateTime::currentMSecsSinceEpoch()/100));
|
|
objUpdates.insert("poses",QJsonValue(objposeData));
|
|
objUpdates.insert("poses",QJsonValue(objposeData));
|
|
- objUpdates.insert("primitives",QJsonValue(objPriData));
|
|
|
|
|
|
+// objUpdates.insert("primitives",QJsonValue(objPriData));
|
|
objUpdates.insert("time_series",QJsonValue(arrTimeSeries));
|
|
objUpdates.insert("time_series",QJsonValue(arrTimeSeries));
|
|
arrUpdates.insert(0,QJsonValue(objUpdates));
|
|
arrUpdates.insert(0,QJsonValue(objUpdates));
|
|
|
|
|
|
@@ -869,7 +872,7 @@ QJsonObject DataCluster::fillFrame()
|
|
objFrame.insert("type",QJsonValue("xviz/state_update"));
|
|
objFrame.insert("type",QJsonValue("xviz/state_update"));
|
|
objFrame.insert("data",QJsonValue(objData));
|
|
objFrame.insert("data",QJsonValue(objData));
|
|
|
|
|
|
- // qDebug()<<"frame: "<<objFrame;
|
|
|
|
|
|
+// qDebug()<<"frame: "<<objFrame;
|
|
return objFrame;
|
|
return objFrame;
|
|
}
|
|
}
|
|
|
|
|