Header file for the VW functions.
More...
#include <stdio.h>
#include "serial.h"
#include "types.h"
Go to the source code of this file.
|
int | VWInit () |
| Initialises the VW with settings defined in hdt file. More...
|
|
int | VWSetSpeed (int linSpeed, int angSpeed) |
| Sets the VW speed, angle. More...
|
|
int | VWGetSpeed (int *linSspeed, int *angSpeed) |
| Obtains the current speeds. More...
|
|
int | VWSetPosition (int x, int y, int phi) |
| Sets the position wrt current position. More...
|
|
int | VWGetPosition (int *x, int *y, int *phi) |
| Gets the position wrt original position. More...
|
|
int | VWControl (int Vv, int Tv, int Vw, int Tw) |
| SStarts VW control. More...
|
|
int | VWControlOff (void) |
| Stopss VW control. More...
|
|
int | VWStraight (int dist, int lin_speed) |
| Drives straight. More...
|
|
int | VWTurn (int angle, int ang_speed) |
| Turns the vehicle on the spot. More...
|
|
int | VWCurve (int dist, int angle, int lin_speed) |
| Turns the vehicle in a curve. More...
|
|
int | VWDriveRemain (void) |
| Checks the remaining drive time. More...
|
|
int | VWDriveDone (void) |
| Checks to see if the current drive is complete. More...
|
|
int | VWDriveWait (void) |
| Blocks until the drive is complete. More...
|
|
int | VWStalled (void) |
| Checks to see if the vehicle is stalled. More...
|
|
Header file for the VW functions.
- Author
- Marcus Pham
int VWControl |
( |
int |
Vv, |
|
|
int |
Tv, |
|
|
int |
Vw, |
|
|
int |
Tw |
|
) |
| |
SStarts VW control.
- Parameters
-
- Returns
- 0 on success, 1 othewrise
int VWControlOff |
( |
void |
| ) |
|
Stopss VW control.
- Returns
- 0 on success, 1 othewrise
int VWCurve |
( |
int |
dist, |
|
|
int |
angle, |
|
|
int |
lin_speed |
|
) |
| |
Turns the vehicle in a curve.
- Parameters
-
dist | the radial distance |
angle | the angle to rotate |
lin_speed | the speed to rotate |
- Returns
- 0 on success, 1 othewrise
Checks to see if the current drive is complete.
- Returns
- 1 on completion, 0 for still driving, -1 on failure
int VWDriveRemain |
( |
void |
| ) |
|
Checks the remaining drive time.
- Returns
- the remaining time
Blocks until the drive is complete.
- Returns
- 0 on success, 1 othewrise
int VWGetPosition |
( |
int * |
x, |
|
|
int * |
y, |
|
|
int * |
phi |
|
) |
| |
Gets the position wrt original position.
- Parameters
-
x | stores the horizontal component |
y | stores the vertical component |
phi | stores the turn angle |
- Returns
- 0 on success, 1 othewrise
int VWGetSpeed |
( |
int * |
linSpeed, |
|
|
int * |
angSpeed |
|
) |
| |
Obtains the current speeds.
- Parameters
-
linspeed | the integer to store the linear speed |
angSpeed | the integer to store the angular speed |
- Returns
- 0 on success, 1 othewrise
Initialises the VW with settings defined in hdt file.
- Returns
- 0 on success, 1 othewrise
int VWSetPosition |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
phi |
|
) |
| |
Sets the position wrt current position.
- Parameters
-
x | the horizontal component |
y | the vertical component |
phi | the turn angle |
- Returns
- 0 on success, 1 othewrise
int VWSetSpeed |
( |
int |
linSpeed, |
|
|
int |
angSpeed |
|
) |
| |
Sets the VW speed, angle.
- Parameters
-
linSpeed | the straightline speed |
angSpeed | the angular turning speed |
- Returns
- 0 on success, 1 othewrise
Checks to see if the vehicle is stalled.
- Returns
- 0 on stalled, 1 othewrise
int VWStraight |
( |
int |
dist, |
|
|
int |
lin_speed |
|
) |
| |
Drives straight.
- Parameters
-
dist | the distance to travel |
lin_speed | the speed to travel at |
- Returns
- 0 on success, 1 othewrise
int VWTurn |
( |
int |
angle, |
|
|
int |
ang_speed |
|
) |
| |
Turns the vehicle on the spot.
- Parameters
-
angle | the angle to turn to |
ang_speed | the speed to turn the angle |
- Returns
- 0 on success, 1 othewrise