Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / mapping / odometry / odometry.h @ 1443

History | View | Annotate | Download (1.35 KB)

1 889 justin
2 948 justin
/**
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 889 justin
#ifndef __ODOMETRY_C__
12
#define __ODOMETRY_C__
13
14 949 justin
/**
15
 * @addtogroup odometry
16
 * @{
17
 **/
18
19 889 justin
//Odometry resolution, *64 microseconds.
20 913 justin
#define ODOMETRY_CLK 255u
21 949 justin
#define TIME_SCALE 64
22 889 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 913 justin
#define ROBOT_WIDTH_UM 137000  //um
29 889 justin
#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 947 justin
34 948 justin
/** @brief Retrieve the robots estimated x position*/
35 924 justin
long odometry_dx(void);
36 949 justin
37 948 justin
/** @brief Retrieve the robots estimated y position*/
38 924 justin
long odometry_dy(void);
39 949 justin
40 948 justin
/** @brief Retrieve the robots estimated orientation*/
41 909 justin
double odometry_angle(void);
42 949 justin
43 948 justin
/** @brief Initialize odometry. MUST be called before
44
 * the other functions work.**/
45 889 justin
void odometry_init(void);
46 949 justin
47 948 justin
/** @brief Reset position and orientation to the origin facing
48
 * the x axis.*/
49 889 justin
void odometry_reset(void);
50
51 949 justin
/** @brief Report estimated velocity [mm/s].*/
52
long odometry_velocity(void);
53
54 963 justin
void odometry_set_velocity(long velocity, double angular_velocity,
55
        int start_speed, int start_angle);
56
57 949 justin
/**@}**/ //end group
58
59 889 justin
#endif