Project

General

Profile

Revision 949

Added a odometry_velocity function that gives approximate speed of the robot in mm/s.

View differences:

odometry.h
11 11
#ifndef __ODOMETRY_C__
12 12
#define __ODOMETRY_C__
13 13

  
14
/**
15
 * @addtogroup odometry 
16
 * @{
17
 **/
18

  
14 19
//Odometry resolution, *64 microseconds.
15
//= approx. 100 ms
16 20
#define ODOMETRY_CLK 255u 
21
#define TIME_SCALE 64
17 22

  
18 23
//Wheel = 2.613 in.  
19 24
//Circumference = 208.508133 mm
......
23 28
#define ROBOT_WIDTH_UM 137000  //um
24 29
#define CLICK_DISTANCE_UM 204 //um
25 30

  
26
#define DISTANCE_SCALE 2.10526316
27
#define ANGLE_SCALE 1.12823207
31
#define DISTANCE_SCALE 2.10526316 //Magic constant.
32
#define ANGLE_SCALE 1.12823207 //Magic constant.
28 33

  
29
//Standard measures will be mm and us
30

  
31 34
/** @brief Retrieve the robots estimated x position*/
32 35
long odometry_dx(void);
36

  
33 37
/** @brief Retrieve the robots estimated y position*/
34 38
long odometry_dy(void);
39

  
35 40
/** @brief Retrieve the robots estimated orientation*/
36 41
double odometry_angle(void);
42

  
37 43
/** @brief Initialize odometry. MUST be called before 
38 44
 * the other functions work.**/
39 45
void odometry_init(void);
46

  
40 47
/** @brief Reset position and orientation to the origin facing
41 48
 * the x axis.*/
42 49
void odometry_reset(void);
43 50

  
51
/** @brief Report estimated velocity [mm/s].*/
52
long odometry_velocity(void);
53

  
54
/**@}**/ //end group
55

  
44 56
#endif

Also available in: Unified diff