odometry.h
1 /*
2  * Player - One Hell of a Robot Server
3  * Copyright (C) 2003
4  * Andrew Howard
5  * Brian Gerkey
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  */
22 
23 
24 /**************************************************************************
25  * Desc: Sensor/action models for odometry.
26  * Author: Andrew Howard
27  * Date: 15 Dec 2002
28  * CVS: $Id$
29  *************************************************************************/
30 
31 #ifndef ODOMETRY_H
32 #define ODOMETRY_H
33 
34 #include "../pf/pf.h"
35 #include "../pf/pf_pdf.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 
42 // Model information
43 typedef struct
44 {
45  // PDF used for initialization
46  pf_pdf_gaussian_t *init_pdf;
47 
48  // PDF used to generate action samples
49  pf_pdf_gaussian_t *action_pdf;
50 
51 } odometry_t;
52 
53 
54 // Create an sensor model
55 odometry_t *odometry_alloc();
56 
57 // Free an sensor model
58 void odometry_free(odometry_t *sensor);
59 
60 // Prepare to initialize the distribution
61 void odometry_init_init(odometry_t *self, pf_vector_t mean, pf_matrix_t cov);
62 
63 // Finish initializing the distribution
64 void odometry_init_term(odometry_t *self);
65 
66 // Initialize the distribution
67 pf_vector_t odometry_init_model(odometry_t *self);
68 
69 // Prepare to update the distribution using the action model.
70 void odometry_action_init(odometry_t *self, pf_vector_t old_pose, pf_vector_t new_pose);
71 
72 // Finish updating the distrubiotn using the action model
73 void odometry_action_term(odometry_t *self);
74 
75 // The action model function
76 pf_vector_t odometry_action_model(odometry_t *self, pf_vector_t pose);
77 
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif
84 
Definition: pf_vector.h:42
Generic message header.
Definition: player.h:162
virtual int MainSetup(void)
Sets up the resources needed by the driver thread.
Definition: driver.h:658
virtual void MainQuit(void)
Cleanup method for driver thread (called when main exits)
Definition: driver.h:664
const char * ReadString(int section, const char *name, const char *value)
Read a string value.
virtual void Main(void)=0
Main method for driver thread.
Definition: pf_pdf.h:49
#define PLAYER_MSGTYPE_DATA
A data message.
Definition: player.h:95
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
bool ReadBool(int section, const char *name, bool value)
Read a boolean value (one of: yes, no, true, false, 1, 0)
#define PLAYER_MSGTYPE_REQ
A request message.
Definition: player.h:106
Definition: odometry.h:44
Class for loading configuration file information.
Definition: configfile.h:197
#define PLAYER_CAPABILITIES_REQ
Capability request message type.
Definition: player.h:397
An autopointer for the message queue.
Definition: message.h:74
#define PLAYER_ERROR1(msg, a)
Definition: error.h:82
Base class for drivers which oeprate with a thread.
Definition: driver.h:553
Definition: pf_vector.h:49
Base class for all drivers.
Definition: driver.h:109
#define PLAYER_MSGQUEUE_DEFAULT_MAXLEN
Default maximum length for a message queue.
Definition: player.h:76