Go to the documentation of this file.00001
00007 #ifndef __STATE_DATA_H
00008 #define __STATE_DATA_H
00009
00014 class RobotState {
00015 public:
00016
00018 RobotState(): x(0), y(0), theta(0) {}
00019
00024 RobotState(double x, double y, double theta) : x(x), y(y), theta(theta) {}
00025
00030 void update(double d_x, double d_y, double d_theta) {
00031
00032
00033 x += d_x;
00034 y += d_y;
00035 theta += d_theta;
00036 }
00037 public:
00038 double x, y, theta;
00039 };
00040
00041
00042 #include "maps/grid_map.h"
00043
00044
00048 template <typename ObservationType, typename MapType>
00049 class World {
00050 public:
00051
00052
00057 virtual void update_robot_pose(double x, double y, double theta) {
00058 _pose.update(x, y, theta);
00059 }
00060
00062 virtual void handle_observation(ObservationType&) = 0;
00063
00064
00066 virtual const World<ObservationType, MapType>& world() const { return *this; }
00067
00069 virtual const RobotState& pose() const { return _pose; }
00070
00072 virtual const MapType& map() const = 0;
00073 private:
00074 RobotState _pose;
00075 };
00076
00077 #endif