root / trunk / code / projects / libdragonfly / odometry.h @ 948
History | View | Annotate | Download (1.1 KB)
1 |
|
---|---|
2 |
/**
|
3 |
* @file odometry.h
|
4 |
* @brief Code for estimating the robots pose.
|
5 |
*
|
6 |
* Offers simple position and orientation information.
|
7 |
*
|
8 |
* @author Colony Project, CMU Robotics Club
|
9 |
**/
|
10 |
|
11 |
#ifndef __ODOMETRY_C__
|
12 |
#define __ODOMETRY_C__
|
13 |
|
14 |
//Odometry resolution, *64 microseconds.
|
15 |
//= approx. 100 ms
|
16 |
#define ODOMETRY_CLK 255u |
17 |
|
18 |
//Wheel = 2.613 in.
|
19 |
//Circumference = 208.508133 mm
|
20 |
//Distance per encoder click (circumference / 1024) = 203.621224 um.
|
21 |
//Robot width = 5.3745 in. = 136.5123 mm
|
22 |
|
23 |
#define ROBOT_WIDTH_UM 137000 //um |
24 |
#define CLICK_DISTANCE_UM 204 //um |
25 |
|
26 |
#define DISTANCE_SCALE 2.10526316 |
27 |
#define ANGLE_SCALE 1.12823207 |
28 |
|
29 |
//Standard measures will be mm and us
|
30 |
|
31 |
/** @brief Retrieve the robots estimated x position*/
|
32 |
long odometry_dx(void); |
33 |
/** @brief Retrieve the robots estimated y position*/
|
34 |
long odometry_dy(void); |
35 |
/** @brief Retrieve the robots estimated orientation*/
|
36 |
double odometry_angle(void); |
37 |
/** @brief Initialize odometry. MUST be called before
|
38 |
* the other functions work.**/
|
39 |
void odometry_init(void); |
40 |
/** @brief Reset position and orientation to the origin facing
|
41 |
* the x axis.*/
|
42 |
void odometry_reset(void); |
43 |
|
44 |
#endif
|