|
@@ -305,6 +305,8 @@ ADCIntelligentVehicle::ADCIntelligentVehicle(QWidget *parent)
|
|
|
ModuleFun funplantrace_right = std::bind(&ADCIntelligentVehicle::UpdatePlanTrace_right,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
|
|
|
mpaplantrace_right = iv::modulecomm::RegisterRecvPlus("obstraceright",funplantrace_right);
|
|
|
|
|
|
+ ModuleFun funfusion = std::bind(&ADCIntelligentVehicle::UpdateFusion,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
|
|
|
+ mpafusion = iv::modulecomm::RegisterRecvPlus("li_ra_fusion",funfusion);
|
|
|
|
|
|
|
|
|
ModuleFun funmap = std::bind(&ADCIntelligentVehicle::UpdateMap,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
|
|
@@ -1177,43 +1179,76 @@ void ADCIntelligentVehicle::paintEvent(QPaintEvent *)
|
|
|
// //
|
|
|
//////////////////////////////////////
|
|
|
|
|
|
- painter->setPen(QPen(Qt::black, 2));
|
|
|
- painter->setBrush(Qt::blue);
|
|
|
- QFont esr_font("Microsoft YaHei", 10, 75); //第一个属性是字体(微软雅黑),第二个是大小,第三个是加粗(权重是75)
|
|
|
- painter->setFont(esr_font);
|
|
|
- char coordinate_ear[100];
|
|
|
- iv::radar::radarobjectarray xradararray;
|
|
|
- if(mbradarUpdate)
|
|
|
+ if(ui->checkBox_8->isChecked())
|
|
|
{
|
|
|
- mMutexRadar.lock();
|
|
|
- xradararray.CopyFrom(mradararray);
|
|
|
- mMutexRadar.unlock();
|
|
|
- for (int a = 0; a < xradararray.obj_size(); a++)
|
|
|
+ painter->setPen(QPen(Qt::black, 2));
|
|
|
+ painter->setBrush(Qt::blue);
|
|
|
+ QFont esr_font("Microsoft YaHei", 10, 75); //第一个属性是字体(微软雅黑),第二个是大小,第三个是加粗(权重是75)
|
|
|
+ painter->setFont(esr_font);
|
|
|
+ char coordinate_ear[100];
|
|
|
+ iv::radar::radarobjectarray xradararray;
|
|
|
+ if(mbradarUpdate)
|
|
|
{
|
|
|
- if (xradararray.obj(a).bvalid())
|
|
|
+ mMutexRadar.lock();
|
|
|
+ xradararray.CopyFrom(mradararray);
|
|
|
+ mMutexRadar.unlock();
|
|
|
+ for (int a = 0; a < xradararray.obj_size(); a++)
|
|
|
{
|
|
|
- painter->drawEllipse(xradararray.obj(a).x() * 10 + 450, -((xradararray.obj(a).y() + ServiceCarStatus.esr_y_offset) * 10) + 700, 10, 10);
|
|
|
- sprintf(coordinate_ear, "(%d, %d)", (int)xradararray.obj(a).x(), (int)xradararray.obj(a).y());
|
|
|
- painter->drawText(xradararray.obj(a).x() * 10 + 450, -((xradararray.obj(a).y() + ServiceCarStatus.esr_y_offset ) * 10) + 700, QString(coordinate_ear));
|
|
|
+ if (xradararray.obj(a).bvalid())
|
|
|
+ {
|
|
|
+ painter->drawEllipse(xradararray.obj(a).x() * 10 + 450, -((xradararray.obj(a).y() + ServiceCarStatus.esr_y_offset) * 10) + 700, 10, 10);
|
|
|
+ sprintf(coordinate_ear, "(%d, %d)", (int)xradararray.obj(a).x(), (int)xradararray.obj(a).y());
|
|
|
+ painter->drawText(xradararray.obj(a).x() * 10 + 450, -((xradararray.obj(a).y() + ServiceCarStatus.esr_y_offset ) * 10) + 700, QString(coordinate_ear));
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
+ // mbradarUpdate = false;
|
|
|
}
|
|
|
- // mbradarUpdate = false;
|
|
|
}
|
|
|
|
|
|
|
|
|
- ServiceLidar.copylidarto(Lidar_read); //激光雷达障碍物
|
|
|
- ServiceLidar.copylidarobsto(Lidar_obsread);
|
|
|
- painter->setPen(QColor(255, 0, 0));
|
|
|
- for (unsigned int x = 0; x < Lidar_read->size(); x++)
|
|
|
+ if(ui->checkBox_9->isChecked())
|
|
|
{
|
|
|
- //painter->drawPoint(((*Lidar_read)[x].nomal_x) * 10 + 450, -(*Lidar_read)[x].nomal_y * 10 + 700);
|
|
|
+ ServiceLidar.copylidarto(Lidar_read); //激光雷达障碍物
|
|
|
+ ServiceLidar.copylidarobsto(Lidar_obsread);
|
|
|
+ painter->setPen(QColor(255, 0, 0));
|
|
|
+ for (unsigned int x = 0; x < Lidar_read->size(); x++)
|
|
|
+ {
|
|
|
+ //painter->drawPoint(((*Lidar_read)[x].nomal_x) * 10 + 450, -(*Lidar_read)[x].nomal_y * 10 + 700);
|
|
|
+ }
|
|
|
+ painter->setPen(QColor(255,0,0));
|
|
|
+ for (unsigned int x = 0; x < Lidar_obsread->size(); x++)
|
|
|
+ {
|
|
|
+ painter->drawPoint(((*Lidar_obsread)[x].nomal_x) * 10 + 450, -((*Lidar_obsread)[x].nomal_y + ServiceCarStatus.lidar_y_offset) * 10 + 700);
|
|
|
+ }
|
|
|
}
|
|
|
- painter->setPen(QColor(255,0,0));
|
|
|
- for (unsigned int x = 0; x < Lidar_obsread->size(); x++)
|
|
|
+
|
|
|
+
|
|
|
+ //////////////////////////////////////
|
|
|
+ // //
|
|
|
+ // 显示融合的信息 //
|
|
|
+ // //
|
|
|
+ //////////////////////////////////////
|
|
|
+
|
|
|
+ if(ui->checkBox_10->isChecked())
|
|
|
{
|
|
|
- painter->drawPoint(((*Lidar_obsread)[x].nomal_x) * 10 + 450, -((*Lidar_obsread)[x].nomal_y + ServiceCarStatus.lidar_y_offset) * 10 + 700);
|
|
|
- }
|
|
|
+ painter->setPen(QColor(0,255,0));
|
|
|
+ iv::fusion::fusionobjectarray xfusionarray;
|
|
|
+ if(mbfusionUpdate)
|
|
|
+ {
|
|
|
+ mMutexFusion.lock();
|
|
|
+ xfusionarray.CopyFrom(mfusionarray);
|
|
|
+ mMutexFusion.unlock();
|
|
|
+ for(int a = 0; a < xfusionarray.obj_size(); a++)
|
|
|
+ {
|
|
|
+ for(int b = 0; b < xfusionarray.obj(a).nomal_centroid_size(); b++)
|
|
|
+ {
|
|
|
+ painter->drawPoint((xfusionarray.obj(a).nomal_centroid(b).nomal_x())*10 + 450, -(xfusionarray.obj(a).nomal_centroid(b).nomal_y())*10 + 700);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1477,6 +1512,22 @@ void ADCIntelligentVehicle::UpdatePlanTrace_right(const char * strdata,const uns
|
|
|
}
|
|
|
|
|
|
|
|
|
+void ADCIntelligentVehicle::UpdateFusion(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
|
|
|
+{
|
|
|
+ iv::fusion::fusionobjectarray xfusionarray;
|
|
|
+ if(!xfusionarray.ParseFromArray(strdata,nSize))
|
|
|
+ {
|
|
|
+ gIvlog->warn("ADCIntelligentVehicle::UpdateFusion Parse Error.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ mMutexFusion.lock();
|
|
|
+ mfusionarray.CopyFrom(xfusionarray);
|
|
|
+ mbfusionUpdate = true;
|
|
|
+ mMutexFusion.unlock();
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* @brief ADCIntelligentVehicle::UpdateMap
|
|
|
* @param strdata
|