Skip to content

Commit

Permalink
MSVC fixes after UNUSED_PARAM() additions
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Sep 12, 2014
1 parent e2a99d7 commit ac814ed
Show file tree
Hide file tree
Showing 13 changed files with 134 additions and 72 deletions.
6 changes: 1 addition & 5 deletions libs/base/include/mrpt/utils/CLoadableOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ namespace utils
*/
virtual void saveToConfigFile(
mrpt::utils::CConfigFileBase &target,
const std::string &section) const
{
MRPT_UNUSED_PARAM(target); MRPT_UNUSED_PARAM(section);
throw std::logic_error("The child class does not implement this method.");
}
const std::string &section) const;

/** Behaves like saveToConfigFile, but you can pass directly a file name and a temporary CConfigFile object will be created automatically to save the file.
* \sa saveToConfigFile, loadFromConfigFileName
Expand Down
8 changes: 8 additions & 0 deletions libs/base/src/utils/CLoadableOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ void CLoadableOptions::loadFromConfigFileName(
this->loadFromConfigFile(f,section);
}

void CLoadableOptions::saveToConfigFile(
mrpt::utils::CConfigFileBase &target,
const std::string &section) const
{
MRPT_UNUSED_PARAM(target); MRPT_UNUSED_PARAM(section);
throw std::logic_error("The child class does not implement this method.");
}

void CLoadableOptions::saveToConfigFileName(
const std::string &config_file,
const std::string &section) const
Expand Down
4 changes: 4 additions & 0 deletions libs/hwdrivers/src/aria/src/ArModuleLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,15 @@ AREXPORT ArModuleLoader::Status ArModuleLoader::load(const char *modName,
return(STATUS_FAILED_OPEN);
}

#ifndef _MSC_VER
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-fstrict-aliasing"
#endif
//func=(bool(*)(ArRobot*,void*))dlsym(handle, "ariaInitModule");
func=reinterpret_cast<TFunc>( dlsym(handle, "ariaInitModule") );
#ifndef _MSC_VER
#pragma GCC diagnostic pop
#endif
if (!func || dlerror() != NULL)
{
if (!quiet)
Expand Down
7 changes: 1 addition & 6 deletions libs/maps/include/mrpt/slam/CHeightGridMap2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,7 @@ namespace mrpt
const CPose3D &otherMapPose,
float maxDistForCorr = 0.10f,
float maxMahaDistForCorr = 2.0f
) const
{
MRPT_UNUSED_PARAM(otherMap); MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(maxDistForCorr); MRPT_UNUSED_PARAM(maxMahaDistForCorr);
return 0;
}
) const;

/** The implementation in this class just calls all the corresponding method of the contained metric maps.
*/
Expand Down
7 changes: 1 addition & 6 deletions libs/maps/include/mrpt/slam/COccupancyGridMap2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -983,12 +983,7 @@ namespace slam
const CPose3D &otherMapPose,
float maxDistForCorr = 0.10f,
float maxMahaDistForCorr = 2.0f
) const
{
MRPT_UNUSED_PARAM(otherMap); MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(maxDistForCorr); MRPT_UNUSED_PARAM(maxMahaDistForCorr);
return 0;
}
) const;

/** This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >, as an image or in any other applicable way (Notice that other methods to save the map may be implemented in classes implementing this virtual interface).
*/
Expand Down
7 changes: 1 addition & 6 deletions libs/maps/include/mrpt/slam/CRandomFieldGridMap2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,7 @@ namespace slam
const CPose3D &otherMapPose,
float maxDistForCorr = 0.10f,
float maxMahaDistForCorr = 2.0f
) const
{
MRPT_UNUSED_PARAM(otherMap); MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(maxDistForCorr); MRPT_UNUSED_PARAM(maxMahaDistForCorr);
return 0;
}
) const;


/** The implementation in this class just calls all the corresponding method of the contained metric maps.
Expand Down
7 changes: 1 addition & 6 deletions libs/maps/include/mrpt/slam/CReflectivityGridMap2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,7 @@ namespace mrpt
const CPose3D &otherMapPose,
float maxDistForCorr = 0.10f,
float maxMahaDistForCorr = 2.0f
) const
{
MRPT_UNUSED_PARAM(otherMap); MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(maxDistForCorr); MRPT_UNUSED_PARAM(maxMahaDistForCorr);
return 0;
}
) const;

/** The implementation in this class just calls all the corresponding method of the contained metric maps.
*/
Expand Down
13 changes: 13 additions & 0 deletions libs/maps/src/maps/CHeightGridMap2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,3 +515,16 @@ size_t CHeightGridMap2D::countObservedCells() const
default: THROW_EXCEPTION("countObservedCells() not implemented for this mapType (!?)")
};
}


float CHeightGridMap2D::compute3DMatchingRatio(
const CMetricMap *otherMap,
const CPose3D &otherMapPose,
float maxDistForCorr,
float maxMahaDistForCorr
) const
{
MRPT_UNUSED_PARAM(otherMap); MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(maxDistForCorr); MRPT_UNUSED_PARAM(maxMahaDistForCorr);
return 0;
}
12 changes: 12 additions & 0 deletions libs/maps/src/maps/COccupancyGridMap2D_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,3 +699,15 @@ float COccupancyGridMap2D::computePathCost( float x1, float y1, float x2, float
else return 0;
}

float COccupancyGridMap2D::compute3DMatchingRatio(
const CMetricMap *otherMap,
const CPose3D &otherMapPose,
float maxDistForCorr ,
float maxMahaDistForCorr
) const
{
MRPT_UNUSED_PARAM(otherMap); MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(maxDistForCorr); MRPT_UNUSED_PARAM(maxMahaDistForCorr);
return 0;
}

13 changes: 13 additions & 0 deletions libs/maps/src/maps/CRandomFieldGridMap2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2900,3 +2900,16 @@ bool CRandomFieldGridMap2D::exist_relation_between2cells(
//cout << "Connection not found (false)" << endl;
return false;
}

float CRandomFieldGridMap2D::compute3DMatchingRatio(
const CMetricMap *otherMap,
const CPose3D &otherMapPose,
float maxDistForCorr,
float maxMahaDistForCorr
) const
{
MRPT_UNUSED_PARAM(otherMap); MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(maxDistForCorr); MRPT_UNUSED_PARAM(maxMahaDistForCorr);
return 0;
}

12 changes: 12 additions & 0 deletions libs/maps/src/maps/CReflectivityGridMap2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,15 @@ void CReflectivityGridMap2D::getAs3DObject( mrpt::opengl::CSetOfObjectsPtr &out

MRPT_END
}

float CReflectivityGridMap2D::compute3DMatchingRatio(
const CMetricMap *otherMap,
const CPose3D &otherMapPose,
float maxDistForCorr,
float maxMahaDistForCorr
) const
{
MRPT_UNUSED_PARAM(otherMap); MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(maxDistForCorr); MRPT_UNUSED_PARAM(maxMahaDistForCorr);
return 0;
}
47 changes: 4 additions & 43 deletions libs/obs/include/mrpt/slam/CMetricMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,7 @@ namespace mrpt
const CPose2D & otherMapPose,
TMatchingPairList & correspondences,
const TMatchingParams & params,
TMatchingExtraResults & extraResults ) const
{
MRPT_UNUSED_PARAM(otherMap);
MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(correspondences);
MRPT_UNUSED_PARAM(params);
MRPT_UNUSED_PARAM(extraResults);
MRPT_START
THROW_EXCEPTION("Virtual method not implemented in derived class.")
MRPT_END
}
TMatchingExtraResults & extraResults ) const;

/** Computes the matchings between this and another 3D points map - method used in 3D-ICP.
* This method finds the set of point pairs in each map.
Expand All @@ -255,17 +245,7 @@ namespace mrpt
const CPose3D & otherMapPose,
TMatchingPairList & correspondences,
const TMatchingParams & params,
TMatchingExtraResults & extraResults ) const
{
MRPT_UNUSED_PARAM(otherMap);
MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(correspondences);
MRPT_UNUSED_PARAM(params);
MRPT_UNUSED_PARAM(extraResults);
MRPT_START
THROW_EXCEPTION("Virtual method not implemented in derived class.")
MRPT_END
}
TMatchingExtraResults & extraResults ) const;

/** Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose"
* In the case of a multi-metric map, this returns the average between the maps. This method always return 0 for grid maps.
Expand All @@ -282,17 +262,7 @@ namespace mrpt
const CPose3D &otherMapPose,
float maxDistForCorr = 0.10f,
float maxMahaDistForCorr = 2.0f
) const
{
MRPT_UNUSED_PARAM(otherMap);
MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(maxDistForCorr);
MRPT_UNUSED_PARAM(maxMahaDistForCorr);
MRPT_START
THROW_EXCEPTION("Virtual method not implemented in derived class.")
MRPT_END
}

) const;

/** This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >, as an image or in any other applicable way (Notice that other methods to save the map may be implemented in classes implementing this virtual interface).
*/
Expand All @@ -318,16 +288,7 @@ namespace mrpt

/** Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.
*/
virtual float squareDistanceToClosestCorrespondence(
float x0,
float y0 ) const
{
MRPT_UNUSED_PARAM(x0);
MRPT_UNUSED_PARAM(y0);
MRPT_START
THROW_EXCEPTION("Virtual method not implemented in derived class.")
MRPT_END
}
virtual float squareDistanceToClosestCorrespondence(float x0,float y0 ) const;


/** If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points map, return it.
Expand Down
63 changes: 63 additions & 0 deletions libs/obs/src/CMetricMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,66 @@ bool CMetricMap::insertObservationPtr(
bool CMetricMap::canComputeObservationLikelihood( const CObservationPtr &obs ) {
return canComputeObservationLikelihood(obs.pointer());
}

void CMetricMap::determineMatching2D(
const CMetricMap * otherMap,
const CPose2D & otherMapPose,
TMatchingPairList & correspondences,
const TMatchingParams & params,
TMatchingExtraResults & extraResults ) const
{
MRPT_UNUSED_PARAM(otherMap);
MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(correspondences);
MRPT_UNUSED_PARAM(params);
MRPT_UNUSED_PARAM(extraResults);
MRPT_START
THROW_EXCEPTION("Virtual method not implemented in derived class.")
MRPT_END
}


void CMetricMap::determineMatching3D(
const CMetricMap * otherMap,
const CPose3D & otherMapPose,
TMatchingPairList & correspondences,
const TMatchingParams & params,
TMatchingExtraResults & extraResults ) const
{
MRPT_UNUSED_PARAM(otherMap);
MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(correspondences);
MRPT_UNUSED_PARAM(params);
MRPT_UNUSED_PARAM(extraResults);
MRPT_START
THROW_EXCEPTION("Virtual method not implemented in derived class.")
MRPT_END
}


float CMetricMap::compute3DMatchingRatio(
const CMetricMap *otherMap,
const CPose3D &otherMapPose,
float maxDistForCorr,
float maxMahaDistForCorr
) const
{
MRPT_UNUSED_PARAM(otherMap);
MRPT_UNUSED_PARAM(otherMapPose);
MRPT_UNUSED_PARAM(maxDistForCorr);
MRPT_UNUSED_PARAM(maxMahaDistForCorr);
MRPT_START
THROW_EXCEPTION("Virtual method not implemented in derived class.")
MRPT_END
}

float CMetricMap::squareDistanceToClosestCorrespondence(
float x0,
float y0 ) const
{
MRPT_UNUSED_PARAM(x0);
MRPT_UNUSED_PARAM(y0);
MRPT_START
THROW_EXCEPTION("Virtual method not implemented in derived class.")
MRPT_END
}

0 comments on commit ac814ed

Please sign in to comment.