38 return sInstance.
Get();
97 , m_SensorName(rSensorName)
118 kt_int8u* pDataPtr = m_pOccupancyGrid->GetDataPointer();
119 kt_int32u* pCellPassCntPtr = m_pOccupancyGrid->m_pCellPassCnt->GetDataPointer();
120 kt_int32u* pCellHitCntPtr = m_pOccupancyGrid->m_pCellHitsCnt->GetDataPointer();
122 m_pOccupancyGrid->UpdateCell(&pDataPtr[index], pCellPassCntPtr[index], pCellHitCntPtr[index]);
131 rStream <<
"Error detect: " << std::endl;
132 rStream <<
" ==> error code: " << rException.
GetErrorCode() << std::endl;
133 rStream <<
" ==> error message: " << rException.
GetErrorMessage() << std::endl;
154 for (
kt_int32u i = 0; i < m_NumberOfRangeReadings; i++, beamNum++)
156 kt_double rangeReading = pRangeReadings[i];
158 if (ignoreThresholdPoints)
160 if (!
math::InRange(rangeReading, GetMinimumRange(), GetRangeThreshold()))
167 rangeReading =
math::Clip(rangeReading, GetMinimumRange(), GetRangeThreshold());
170 kt_double angle = scanPose.
GetHeading() + GetMinimumAngle() + beamNum * GetAngularResolution();
174 point.
SetX(scanPose.
GetX() + (rangeReading * cos(angle)));
175 point.
SetY(scanPose.
GetY() + (rangeReading * sin(angle)));
177 if (pCoordinateConverter != NULL)
184 pointReadings.push_back(point);
187 return pointReadings;
198 <<
" range readings, expected " << GetNumberOfRangeReadings() << std::endl;
216 m_Parameters.clear();
218 m_ParameterLookup.clear();
223 if (pParameter != NULL && pParameter->
GetName() !=
"")
225 if (m_ParameterLookup.find(pParameter->
GetName()) == m_ParameterLookup.end())
227 m_Parameters.push_back(pParameter);
229 m_ParameterLookup[pParameter->
GetName()] = pParameter;
virtual kt_bool Validate()
kt_double GetHeading() const
std::vector< Vector2< kt_double > > PointVectorDouble
const PointVectorDouble GetPointReadings(LocalizedRangeScan *pLocalizedRangeScan, CoordinateConverter *pCoordinateConverter, kt_bool ignoreThresholdPoints=true, kt_bool flipY=false) const
const std::string & GetName() const
Sensor(const Name &rName)
Parameter< Pose2 > * m_pOffsetPose
#define forEach(listtype, list)
SensorData(const Name &rSensorName)
Pose2 GetSensorPose() const
const std::string & GetErrorMessage() const
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
std::ostream & operator<<(std::ostream &rStream, Exception &rException)
std::vector< AbstractParameter * > ParameterVector
kt_double * GetRangeReadings() const
kt_int32u GetNumberOfRangeReadings() const
Vector2< kt_int32s > WorldToGrid(const Vector2< kt_double > &rWorld, kt_bool flipY=false) const
void Add(AbstractParameter *pParameter)