amcl_laser.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00021
00022
00023
00024
00025
00026
00028
00029 #ifndef AMCL_LASER_H
00030 #define AMCL_LASER_H
00031
00032 #include "amcl_sensor.h"
00033 #include "map/map.h"
00034 #include "models/laser.h"
00035
00036
00037 class AMCLLaserData : public AMCLSensorData
00038 {
00039
00040 public: int range_count;
00041 public: double range_max;
00042 public: double ranges[PLAYER_LASER_MAX_SAMPLES][2];
00043 };
00044
00045
00046
00047 class AMCLLaser : public AMCLSensor
00048 {
00049
00050 public: AMCLLaser(AdaptiveMCL & aAMCL, player_devaddr_t addr);
00051
00052
00053 public: virtual int Load(ConfigFile* cf, int section);
00054
00055
00056 public: virtual int Unload(void);
00057
00058
00059 public: virtual int Setup(void);
00060
00061
00062 public: virtual int Shutdown(void);
00063
00064
00065 public: virtual int ProcessMessage(MessageQueue * resp_queue,
00066 player_msghdr * hdr,
00067 void * data);
00068
00069
00070
00071
00072
00073 public: virtual bool UpdateSensor(pf_t *pf, AMCLSensorData *data);
00074
00075
00076 private: static double SensorModel(AMCLLaserData *data,
00077 pf_sample_set_t* set);
00078
00079
00080 private: int SetupMap(void);
00081
00082
00083 private: player_devaddr_t laser_addr;
00084 private: player_devaddr_t map_addr;
00085 private: Device *laser_dev;
00086
00087
00088 private: double time;
00089
00090
00091 private: map_t *map;
00092
00093
00094 private: pf_vector_t laser_pose;
00095
00096
00097 private: int max_beams;
00098
00099
00100 private: double range_var;
00101
00102
00103 private: double range_bad;
00104
00105 #ifdef INCLUDE_RTKGUI
00106
00107 private: virtual void SetupGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig);
00108
00109
00110 private: virtual void ShutdownGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig);
00111
00112
00113 public: virtual void UpdateGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig, AMCLSensorData *data);
00114
00115
00116 private: rtk_fig_t *fig, *map_fig;
00117 #endif
00118 };
00119
00120
00121
00122
00123 #endif
Last updated 12 September 2005 21:38:45
|