[SLAM] Gmapping Source Reading

Source: Internet
Author: User
Tags cos

1. Motion Model

2. Scan match

Note that the principle of the Scanmatcher::score () function is the Likehood_field_range_finder_model method, referring to the "probabilistic Robot" manuscript P143 page, Scanmatcher::optimize () method, an optimal particle is obtained.

1 //The method here is the Likehood_field_range_finder_model method, referring to the "probabilistic Robot" manuscript P1432InlineDoubleScanmatcher::score (Constscanmatchermap& map,Constorientedpoint& p,Const Double* Readings)Const{3     Doubles=0;4     Const Double* angle=m_laserangles+M_initialbeamsskip;5Orientedpoint lp=p;6Lp.x+=cos (P.theta) *m_laserpose.x-sin (P.theta) *m_laserpose.y;7Lp.y+=sin (P.theta) *m_laserpose.x+cos (P.theta) *m_laserpose.y;8lp.theta+=M_laserpose.theta;9Unsignedintskip=0;Ten     DoubleFreedelta=map.getdelta () *M_freecellratio; One      for(Const Double* R=READINGS+M_INITIALBEAMSSKIP; r<readings+m_laserbeams; r++, angle++){ Askip++; -Skip=skip>m_likelihoodskip?0: Skip; -         if(*r>m_usablerange)Continue; the         if(Skip)Continue; -Point phit=LP; -Phit.x+=*r*cos (lp.theta+*angle); -Phit.y+=*r*sin (lp.theta+*angle); +Intpoint iphit=Map.world2map (phit); -Point pfree=LP; +pfree.x+= (*r-map.getdelta () *freedelta) *cos (lp.theta+*angle); Apfree.y+= (*r-map.getdelta () *freedelta) *sin (lp.theta+*angle); atpfree=pfree-Phit; -Intpoint ipfree=Map.world2map (pfree); -         BOOLFound=false; -Point BESTMU (0.,0.); -          for(intXx=-m_kernelsize; xx<=m_kernelsize; xx++) -          for(intYy=-m_kernelsize; yy<=m_kernelsize; yy++){ inIntpoint pr=iphit+Intpoint (xx,yy); -Intpoint pf=pr+Ipfree; to             //accessibilitystate s=map.storage (). Cellstate (PR); +             //if (s&inside && s&allocated) { -                 Constpointaccumulator& cell=Map.cell (PR); the                 Constpointaccumulator& fcell=Map.cell (PF); *                 if(((Double)) > M_fullnessthreshold && ((Double) Fcell) <m_fullnessthreshold) { $Point mu=phit-Cell.mean ();Panax Notoginseng                     if(!found) { -bestmu=mu; theFound=true; +}Else Abestmu= (MU*MU) < (BESTMU*BESTMU)?MU:BESTMU; the                 } +             //} -         } $         if(found) $S+=exp (-1./M_GAUSSIANSIGMA*BESTMU*BESTMU);//Gaussian proposal Distribution -     } -     returns; the}
View Code

The Scanmatcher::likelihoodandscore () and Scanmatcher::score () methods are basically consistent. However, the newly obtained particles are calculated q, which is prepared for the subsequent weights calculation.

[SLAM] Gmapping Source Reading

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.