40 _dataBufferMaxSize(dataBufferMaxSize),
41 _resetOdometry(
false),
44 _imuEstimatedDelay(0.0)
78 if(event->
getClassName().compare(
"OdometryResetEvent") == 0)
120 UDEBUG(
"Processing data...");
135 if(dynamic_cast<OdometryMono*>(
_odometry) == 0)
140 ULOGGER_ERROR(
"Missing some information (images/scans empty or missing calibration)!?");
149 ULOGGER_ERROR(
"Missing some information (image empty or missing calibration)!?");
163 UDEBUG(
"Data buffer is full, the oldest data is removed to add the new one.");
188 bool dataFilled =
false;
virtual void reset(const Transform &initialPose=Transform::getIdentity())
const cv::Mat & depthOrRightRaw() const
const std::vector< StereoCameraModel > & stereoCameraModels() const
virtual void mainLoopBegin()
bool acquire(int n=1, int ms=0)
void post(UEvent *event, bool async=true) const
Transform process(SensorData &data, OdometryInfo *info=0)
virtual void mainLoopKill()
#define UASSERT(condition)
double _imuEstimatedDelay
const std::vector< CameraModel > & cameraModels() const
std::list< SensorData > _dataBuffer
virtual ~OdometryThread()
virtual std::string getClassName() const =0
const cv::Mat & imageRaw() const
void addData(const SensorData &data)
static void registerCurrentThread(const std::string &name)
unsigned int _dataBufferMaxSize
const LaserScan & laserScanRaw() const
ULogger class and convenient macros.
bool getData(SensorData &data)
const Transform & getPose() const
void unregisterFromEventsManager()
void join(bool killFirst=false)
virtual bool handleEvent(UEvent *event)
#define ULOGGER_ERROR(...)
const IMU & getData() const
OdometryThread(Odometry *odometry, unsigned int dataBufferMaxSize=1)
std::list< SensorData > _imuBuffer
const SensorData & data() const