计算总的坐标转换
m_pDriver->SolverTransMeasure2Driver();
void CDriver::SolverTransMeasure2Driver()
{
//获得了平台坐标系
CHPoint* hPoint = NULL;
hPoint = origin_Intermediate_Measure;
hPoint->x = m_pTransMeasureDriver->GetMatrixElement(0, 3);
hPoint->y = m_pTransMeasureDriver->GetMatrixElement(1, 3);
hPoint->z = m_pTransMeasureDriver->GetMatrixElement(2, 3);
hPoint = e1_Intermediate_Measure;
e1_Intermediate_Measure->x = m_pTransMeasureDriver->GetMatrixElement(0, 0) *100.f + origin_Intermediate_Measure->x;
e1_Intermediate_Measure->y = m_pTransMeasureDriver->GetMatrixElement(0, 1) *100.f + origin_Intermediate_Measure->y;
e1_Intermediate_Measure->z = m_pTransMeasureDriver->GetMatrixElement(0, 2) *100.f + origin_Intermediate_Measure->z;
e2_Intermediate_Measure->x = m_pTransMeasureDriver->GetMatrixElement(1, 0) *100.f + origin_Intermediate_Measure->x;
e2_Intermediate_Measure->y = m_pTransMeasureDriver->GetMatrixElement(1, 1) *100.f + origin_Intermediate_Measure->y;
e2_Intermediate_Measure->z = m_pTransMeasureDriver->GetMatrixElement(1, 2) *100.f + origin_Intermediate_Measure->z;
e3_Intermediate_Measure->x = m_pTransMeasureDriver->GetMatrixElement(2, 0) *100.f + origin_Intermediate_Measure->x;
e3_Intermediate_Measure->y = m_pTransMeasureDriver->GetMatrixElement(2, 1) *100.f + origin_Intermediate_Measure->y;
e3_Intermediate_Measure->z = m_pTransMeasureDriver->GetMatrixElement(2, 2) *100.f + origin_Intermediate_Measure->z;
}
获取Driver坐标系的Intermediate位置和Target位置的值(Measure坐标系下)
将Driver坐标系在Target位置的值(Measure坐标系下)转到Driver坐标系下
m_pDriver->m_pTransMeasureDriver->TransformPointSet(m_pOrdinate_Tag_ByMeas, m_pOrdinate_Tag_BySelf);
void CQTransform::TransformPointSet(CPointSet* m_pFromPointSet, CPointSet *m_pToPointSet){
//先清空数据
m_pToPointSet->DeleteAllPoints();
//转换并添加新数据
POSITION pos = m_pFromPointSet->m_PointList.GetHeadPosition();
while (pos != NULL){
CHPoint* fromPoint = m_pFromPointSet->m_PointList.GetNext(pos);
CHPoint* toPoint = m_pToPointSet->AddPoint();
TransformPoint(fromPoint, toPoint);
}
}
给双相机发送指令
void CPlatformManualDlg::OnButMeasure()
{
// TODO: Add your control notification handler code here
keybd_event(17,0,0,0);
keybd_event(71,0,0,0);
keybd_event(71,0,KEYEVENTF_KEYUP,0);
keybd_event(17,0,KEYEVENTF_KEYUP,0);
}
网友评论