amcl_imu.h
1/*
2 * Player - One Hell of a Robot Server
3 * Copyright (C) 2000 Brian Gerkey et al.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
21//
22// Desc: IMU (compass) sensor model for AMCL
23// Author: Andrew Howard
24// Date: 17 Aug 2003
25// CVS: $Id$
26//
28
29#ifndef AMCL_IMU_H
30#define AMCL_IMU_H
31
32#include "amcl_sensor.h"
33#include "models/imu.h"
34
35// Imuetric sensor model
36class AMCLImu : public AMCLSensor
37{
38 // Default constructor
39 public: AMCLImu();
40
41 // Load the model
42 public: virtual int Load(ConfigFile* cf, int section);
43
44 // Unload the model
45 public: virtual int Unload(void);
46
47 // Initialize the model
48 public: virtual int Setup(void);
49
50 // Finalize the model
51 public: virtual int Shutdown(void);
52
53 // Check for new sensor measurements
54 private: virtual bool GetData(void);
55
56 // Update the filter based on the sensor model. Returns true if the
57 // filter has been updated.
58 public: virtual bool UpdateSensor(pf_t *pf);
59
60 // Device info
61 private: int imu_index;
62 private: Driver *device;
63
64 // Imuetry sensor/action model
65 private: imu_model_t *model;
66
67 // Current data timestamp
68 private: uint32_t tsec, tusec;
69
70 // Magnetic deviation
71 private: double utm_mag_dev;
72
73 // Current IMU data
74 private: double utm_head;
75
76#ifdef INCLUDE_RTKGUI
77 // Setup the GUI
78 private: virtual void SetupGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig);
79
80 // Finalize the GUI
81 private: virtual void ShutdownGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig);
82
83 // Draw sensor data
84 private: virtual void UpdateGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig);
85
86 // IMU figure
87 private: rtk_fig_t *fig;
88#endif
89};
90
91
92
93
94#endif
Definition amcl_imu.h:37
Definition amcl_sensor.h:44
Class for loading configuration file information.
Definition configfile.h:197
Base class for all drivers.
Definition driver.h:109
Definition pf.h:111
Definition imu.h:41