roneos
Operating System for the r-one robot
 All Data Structures Files Functions Variables Typedefs Groups
encoder.h
Go to the documentation of this file.
1 
20 #ifndef ENCODERS_H_
21 #define ENCODERS_H_
22 
23 /******** Defines ********/
24 
25 #define ENCODER_LEFT 0
26 #define ENCODER_RIGHT 1
27 //Micrometerper Encoder count: for 66, robot does not go far enough (1138 mm / 1200 mm)
28 //Micrometerper Encoder count: for 62, robot goes too far (1211 mm / 1200 mm)
29 #define MOTOR_MICROMETERS_PER_ENCODER_COUNT 63 //changed to 63 Um down from 66
30 // wheel base is in mm. is actually 78, BUT (TURNS TOO SMALL) 81, 83, 89 TURNS TOO BIG
31 #define MOTOR_WHEEL_BASE_MM 78
32 
33 
34 
35 /******** Functions ********/
36 
37 
45 void encoderInit(void);
46 
47 
55 int32 encoderGetTicks(uint32 enc);
56 
57 
64 int32 encoderGetDirection(uint32 enc);
65 
66 
73 int32 encoderGetVelocity(uint32 enc);
74 
75 
83 int32 encoderDeltaTicks(uint32 new, uint32 old);
84 
85 
91 void encoderPoseUpdate(void);
92 
93 
99 void encoderPoseClear(void);
100 
101 
108 void encoderGetPose(Pose* posePtr);
109 
110 
117 void encoderSetPose(Pose* posePtr);
118 
119 
125 uint32 encoderGetOdometer(void);
126 
127 
128 #endif /* ENCODERS_H_ */