Skip to content

Commit

Permalink
Issue 42 - compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
joelziemann committed Oct 24, 2023
1 parent ae2b585 commit cf7e1b4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
7 changes: 1 addition & 6 deletions gridfastslam/gfs2log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ using namespace GMapping::GFSReader;

int main (int argc, const char * const * argv){
if (argc<3){
cout << "usage gfs2log [-err] [-neff] [-part] [-odom] <infilename> <outfilename>" << endl;
cout << "usage gfs2log [-err] [-part] [-odom] <infilename> <outfilename>" << endl;
cout << " -odom : dump raw odometry in ODOM message instead of inpolated corrected one" << endl;
return -1;
}
bool err=0;
bool neff=0;
bool part=0;
bool odom=0;
// int particle_num;
Expand All @@ -29,10 +28,6 @@ int main (int argc, const char * const * argv){
err=true;
c++;
}
if (!strcmp(argv[c],"-neff")){
neff=true;
c++;
}
if (!strcmp(argv[c],"-part")){
part=true;
c++;
Expand Down
5 changes: 0 additions & 5 deletions gridfastslam/gfs2rec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,16 +375,11 @@ int main (int argc, const char * const * argv){
return -1;
}
bool err=0;
bool neff=0;
unsigned int c=1;
if (!strcmp(argv[c],"-err")){
err=true;
c++;
}
if (!strcmp(argv[c],"-neff")){
neff=true;
c++;
}
ifstream is(argv[c]);
if (!is){
cout << "could read file "<< endl;
Expand Down
2 changes: 1 addition & 1 deletion include/gmapping/grid/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Point Map<Cell,Storage,isClass>::map2world(const IntPoint& p) const{
template <class Cell, class Storage, const bool isClass>
Cell& Map<Cell,Storage,isClass>::cell(const IntPoint& p) {
AccessibilityState s=m_storage.cellState(p);
if (! s&Inside)
if ( !(s&Inside) )
assert(0);
//if (s&Allocated) return m_storage.cell(p); assert(0);

Expand Down
4 changes: 4 additions & 0 deletions scanmatcher/scanmatch_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ int main(int argc, const char * const * argv){
}
const RangeSensor* rs=dynamic_cast<const RangeSensor*>(rr->getSensor());
assert (rs && rs->beams().size()==rr->size());
if (!rs || rs->beams().size() != rr->size()){
cout << "Invalid RangeSensor." << endl;
return -1;
}
odopathStream << rr->getPose().x << " " << rr->getPose().y << endl;
scanmatcher.processScan(*rr);
OrientedPoint p=scanmatcher.getPose();
Expand Down
6 changes: 3 additions & 3 deletions scanmatcher/scanmatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void ScanMatcher::computeActiveArea(ScanMatcherMap& map, const OrientedPoint& p,
if (d>m_usableRange)
d=m_usableRange;
Point phit=lp+Point(d*cos(lp.theta+*angle),d*sin(lp.theta+*angle));
IntPoint p0=map.world2map(lp);
p0=map.world2map(lp);
IntPoint p1=map.world2map(phit);

//IntPoint linePoints[20000] ;
Expand Down Expand Up @@ -432,7 +432,7 @@ double ScanMatcher::optimize(OrientedPoint& _mean, ScanMatcher::CovarianceMatrix
double bestScore=-1;
OrientedPoint currentPose=init;
ScoredMove sm={currentPose,0,0};
unsigned int matched=likelihoodAndScore(sm.score, sm.likelihood, map, currentPose, readings);
(void)likelihoodAndScore(sm.score, sm.likelihood, map, currentPose, readings);
double currentScore=sm.score;
moveList.push_back(sm);
double adelta=m_optAngularDelta, ldelta=m_optLinearDelta;
Expand Down Expand Up @@ -497,7 +497,7 @@ double ScanMatcher::optimize(OrientedPoint& _mean, ScanMatcher::CovarianceMatrix
localScore=odo_gain*score(map, localPose, readings);
//update the score
count++;
matched=likelihoodAndScore(localScore, localLikelihood, map, localPose, readings);
(void)likelihoodAndScore(localScore, localLikelihood, map, localPose, readings);
if (localScore>currentScore){
currentScore=localScore;
bestLocalPose=localPose;
Expand Down
5 changes: 3 additions & 2 deletions sensor/sensor_range/rangereading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ unsigned int RangeReading::rawView(double* v, double density) const{
};

unsigned int RangeReading::activeBeams(double density) const{
if (density==0.)
if (density==0.){
return size();
int ab=0;
}
int ab=0;
Point lastPoint(0,0);
uint suppressed=0;
for (unsigned int i=0; i<size(); i++){
Expand Down

0 comments on commit cf7e1b4

Please sign in to comment.