26 #include <boost/serialization/export.hpp> 60 return sInstance.
Get();
119 , m_SensorName(rSensorName)
140 kt_int8u* pDataPtr = m_pOccupancyGrid->GetDataPointer();
141 kt_int32u* pCellPassCntPtr = m_pOccupancyGrid->m_pCellPassCnt->GetDataPointer();
142 kt_int32u* pCellHitCntPtr = m_pOccupancyGrid->m_pCellHitsCnt->GetDataPointer();
144 m_pOccupancyGrid->UpdateCell(&pDataPtr[index], pCellPassCntPtr[index], pCellHitCntPtr[index]);
153 rStream <<
"Error detect: " << std::endl;
154 rStream <<
" ==> error code: " << rException.
GetErrorCode() << std::endl;
155 rStream <<
" ==> error message: " << rException.
GetErrorMessage() << std::endl;
176 for (
kt_int32u i = 0; i < m_NumberOfRangeReadings; i++, beamNum++)
178 kt_double rangeReading = pRangeReadings[i];
180 if (ignoreThresholdPoints)
182 if (!
math::InRange(rangeReading, GetMinimumRange(), GetRangeThreshold()))
189 rangeReading =
math::Clip(rangeReading, GetMinimumRange(), GetRangeThreshold());
196 point.
SetX(scanPose.
GetX() + (rangeReading *
cos(angle)));
197 point.
SetY(scanPose.
GetY() + (rangeReading *
sin(angle)));
199 if (pCoordinateConverter !=
NULL)
206 pointReadings.push_back(point);
209 return pointReadings;
220 <<
" range readings, expected " << GetNumberOfRangeReadings() << std::endl;
238 m_Parameters.clear();
240 m_ParameterLookup.clear();
245 if (pParameter !=
NULL && pParameter->
GetName() !=
"")
247 if (m_ParameterLookup.find(pParameter->
GetName()) == m_ParameterLookup.end())
249 m_Parameters.push_back(pParameter);
251 m_ParameterLookup[pParameter->
GetName()] = pParameter;
kt_double * GetRangeReadings() const
virtual kt_bool Validate()
Pose2 GetSensorPose() const
std::vector< Vector2< kt_double > > PointVectorDouble
kt_int32u GetNumberOfRangeReadings() const
Vector2< kt_int32s > WorldToGrid(const Vector2< kt_double > &rWorld, kt_bool flipY=false) const
Parameter< Pose2 > * m_pOffsetPose
#define forEach(listtype, list)
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
virtual ParameterManager * GetParameterManager()
Module(const std::string &rName)
std::vector< CustomData * > CustomDataVector
const T & Clip(const T &n, const T &minValue, const T &maxValue)
virtual void operator()(kt_int32u index)
ParameterManager * m_pParameterManager
virtual const std::string GetValueAsString() const =0
kt_bool InRange(const T &value, const T &a, const T &b)
static SensorManager * GetInstance()
virtual void SetValueFromString(const std::string &rStringValue)=0
CustomDataVector m_CustomData
const std::string & GetName() const
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
std::ostream & operator<<(std::ostream &rStream, Exception &rException)
const std::string & GetErrorMessage() const
BOOST_CLASS_EXPORT_IMPLEMENT(karto::NonCopyable)
std::vector< AbstractParameter * > ParameterVector
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
const PointVectorDouble GetPointReadings(LocalizedRangeScan *pLocalizedRangeScan, CoordinateConverter *pCoordinateConverter, kt_bool ignoreThresholdPoints=true, kt_bool flipY=false) const
void Add(AbstractParameter *pParameter)
kt_double GetHeading() const