00001
00002
00003 #ifndef SIMU_ROBOT_HPP
00004 #define SIMU_ROBOT_HPP
00005
00006 #include <list>
00007
00008 #include "kernel/dataLog.hpp"
00009
00010 #include "jmath/jblas.hpp"
00011
00012 #include "geom/t3dEuler.hpp"
00013
00014 #include "slam/odo3dPredictModel.hpp"
00015 #include "slam/feature.hpp"
00016 #include "slam/segmentFeature.hpp"
00017
00018 namespace jafar {
00019 namespace slam {
00020 class SegmentObservationsSelector;
00021 }
00022 namespace simu {
00023
00024 class Environment;
00025 class Point;
00026 class SensorPoint;
00027 class SensorSegmentImage;
00028 class SensorRobot;
00029
00034 class Robot : public jafar::kernel::DataLoggable {
00035
00036 public:
00037
00038 jafar::slam::OdoNoiseModel const& odoNoiseModel;
00039 jblas::sym_mat gpsNoise;
00040
00041 typedef std::list<jafar::slam::Observation*> SequenceObs;
00042
00044 jafar::geom::T3DEuler pose;
00045
00047 jafar::geom::T3DEuler odoPose;
00048
00049 jafar::geom::T3DEuler robotToSensor;
00050
00052 jblas::vec u;
00053
00055 unsigned int robotId;
00056
00057 Environment* environment;
00058
00059 Robot(jafar::slam::OdoNoiseModel const& odoNoiseModel_, SensorPoint* sensor_,
00060 bool doAddNoise = false, unsigned int randomSeed = 1,
00061 double noiseFactor = 1.0, unsigned int _robotId = 0);
00062
00063 Robot(jafar::slam::OdoNoiseModel const& odoNoiseModel_, SensorSegmentImage* sensor_,
00064 bool doAddNoise = false, unsigned int randomSeed = 1,
00065 double noiseFactor = 1.0, unsigned int _robotId = 0);
00066
00067 Robot(jafar::slam::OdoNoiseModel const& odoNoiseModel_, SensorPoint* sensor_, SensorSegmentImage* segmentSensor_,
00068 bool doAddNoise = false, unsigned int randomSeed = 1,
00069 double noiseFactor = 1.0, unsigned int _robotId = 0);
00070
00071 void setOdometryBias(jblas::vec const& bias_);
00072
00073 void setPose(const jblas::vec& pose_);
00074
00075 jblas::vec const& getRobotToSensor() const;
00076 void setRobotToSensor(const jblas::vec& robotToSensor_);
00077
00078 void moveOdo(double v, double w, double dt);
00079
00080 void fillObservations(SequenceObs& seqObs);
00081
00082 void getGpsPose( jafar::geom::T3DEuler& pose );
00083
00085 unsigned int const getRobotId();
00086
00090 void setSensorRobot( SensorRobot* _sensorRobot );
00094 SensorRobot* getSensorRobot( );
00095
00096 void setSegmentObservationsSelector( jafar::slam::SegmentObservationsSelector* _observationsSelector );
00097 jafar::slam::SegmentObservationsSelector* getSegmentObservationsSelector();
00098 protected:
00099
00100 bool p_doAddNoise;
00101
00103 jafar::jmath::NormalDistribution noise;
00104
00106 jblas::vec bias;
00107
00109 SensorPoint* sensorPt;
00110
00111 SensorSegmentImage* sensorSeg;
00112
00113 SensorRobot* sensorRobot;
00114
00115 jafar::slam::SegmentObservationsSelector* m_obsevationsSelector;
00116
00117 void writeLogHeader(kernel::DataLogger& log) const;
00118 void writeLogData(kernel::DataLogger& log) const;
00119
00120 friend std::ostream& operator <<(std::ostream& s, const Robot& r_);
00121 private:
00122 void initGpsNoise();
00123 };
00124
00125 std::ostream& operator <<(std::ostream& s, const Robot& r_);
00126
00127 }
00128 }
00129
00130 #endif // SIMU_ROBOT_HPP