root / trunk / code / projects / libdragonfly / odometry.h @ 2004
History | View | Annotate | Download (1.25 KB)
1 | 948 | justin | |
---|---|---|---|
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 | 949 | justin | /**
|
15 | * @addtogroup odometry
|
||
16 | * @{
|
||
17 | **/
|
||
18 | |||
19 | 948 | justin | //Odometry resolution, *64 microseconds.
|
20 | #define ODOMETRY_CLK 255u |
||
21 | 949 | justin | #define TIME_SCALE 64 |
22 | 948 | justin | |
23 | //Wheel = 2.613 in.
|
||
24 | //Circumference = 208.508133 mm
|
||
25 | //Distance per encoder click (circumference / 1024) = 203.621224 um.
|
||
26 | //Robot width = 5.3745 in. = 136.5123 mm
|
||
27 | |||
28 | #define ROBOT_WIDTH_UM 137000 //um |
||
29 | #define CLICK_DISTANCE_UM 204 //um |
||
30 | |||
31 | 949 | justin | #define DISTANCE_SCALE 2.10526316 //Magic constant. |
32 | #define ANGLE_SCALE 1.12823207 //Magic constant. |
||
33 | 948 | justin | |
34 | /** @brief Retrieve the robots estimated x position*/
|
||
35 | long odometry_dx(void); |
||
36 | 949 | justin | |
37 | 948 | justin | /** @brief Retrieve the robots estimated y position*/
|
38 | long odometry_dy(void); |
||
39 | 949 | justin | |
40 | 948 | justin | /** @brief Retrieve the robots estimated orientation*/
|
41 | double odometry_angle(void); |
||
42 | 949 | justin | |
43 | 948 | justin | /** @brief Initialize odometry. MUST be called before
|
44 | * the other functions work.**/
|
||
45 | void odometry_init(void); |
||
46 | 949 | justin | |
47 | 948 | justin | /** @brief Reset position and orientation to the origin facing
|
48 | * the x axis.*/
|
||
49 | void odometry_reset(void); |
||
50 | |||
51 | 949 | justin | /** @brief Report estimated velocity [mm/s].*/
|
52 | long odometry_velocity(void); |
||
53 | |||
54 | /**@}**/ //end group |
||
55 | |||
56 | 948 | justin | #endif |