Project

General

Profile

Statistics
| Revision:

root / trunk / code / lib / include / libdragonfly / odometry.h @ 1461

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 1023 bneuman
/**
15
 * @addtogroup odometry
16
 * @{
17
 **/
18
19 948 justin
//Odometry resolution, *64 microseconds.
20
#define ODOMETRY_CLK 255u
21 1023 bneuman
#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 1023 bneuman
#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 1023 bneuman
37 948 justin
/** @brief Retrieve the robots estimated y position*/
38
long odometry_dy(void);
39 1023 bneuman
40 948 justin
/** @brief Retrieve the robots estimated orientation*/
41
double odometry_angle(void);
42 1023 bneuman
43 948 justin
/** @brief Initialize odometry. MUST be called before
44
 * the other functions work.**/
45
void odometry_init(void);
46 1023 bneuman
47 948 justin
/** @brief Reset position and orientation to the origin facing
48
 * the x axis.*/
49
void odometry_reset(void);
50
51 1023 bneuman
/** @brief Report estimated velocity [mm/s].*/
52
long odometry_velocity(void);
53
54
/**@}**/ //end group
55
56 948 justin
#endif