roneos
Operating System for the r-one robot
 All Data Structures Files Functions Variables Typedefs Groups
motor.h
Go to the documentation of this file.
1 
9 #ifndef MOTOR_H_
10 #define MOTOR_H_
11 
12 /******** Defines ********/
13 
14 #define MOTOR_LEFT 0
15 #define MOTOR_RIGHT 1
16 
17 #define MOTOR_COMMAND_MODE_PWM 0
18 #define MOTOR_COMMAND_MODE_VELOCITY 1
19 #define MOTOR_COMMAND_MODE_WAYPOINT 2
20 #define MOTOR_COMMAND_MODE_WAYPOINT_THETA 3
21 
22 #define VELOCITY_MAX 300
23 
24 /******** Functions ********/
25 
33 void motorInit(void);
34 
35 
41 void motorTimeoutStop(void);
42 
43 
51 void motorCommandTimerUpdate(void);
52 
53 
60 void motorBrake(uint32 motor);
61 
62 
71 void motorSetPWM(uint32 motor, int32 dutyCycle);
72 
73 //TODO: Not public/?
85 void motorSetPWM_rc(uint32 motor, int32 dutyCycle);
86 
87 
94 int32 motorGetVelocity(uint32 motor);
95 
96 
105 void motorSetVelocity(uint32 motor, int32 velocity);
106 
107 
115 void motorSetVelocity_rc(uint32 motor, int32 velocity);
116 
117 
126 void motorSetTVRV(int32 tv, int32 rv);
127 
136 void motorSetTVRV_rc(int32 tv, int32 rv);
137 
145 void motorGetTVRV(int32* tvPtr, int32* rvPtr);
146 
152 boolean waypointMoveDone(void);
153 
154 
163 void waypointMove(Pose* posePtr, int32 speed);
164 
174 void waypointMoveRelative(Pose* posePtr, int32 speed);
175 
176 
185 void waypointMoveTheta(Pose* posePtr, int32 speed);
186 
196 void waypointMoveThetaRelative(Pose* posePtr, int32 speed);
197 
204 void motorVelocityUpdate(void);
205 
206 
207 #endif /* MOTOR_H_ */