Welcome to the EyeBot  Version 7 - RPi1
A Controller For Various Hardware IO
Functions | Variables
vomega.h File Reference

Header file for the VW functions. More...

#include <stdio.h>
#include "serial.h"
#include "types.h"

Go to the source code of this file.

Functions

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...
 

Variables

int VWInitialised
 

Detailed Description

Header file for the VW functions.

Author
Marcus Pham

Function Documentation

int VWControl ( int  Vv,
int  Tv,
int  Vw,
int  Tw 
)

SStarts VW control.

Parameters
Vv
Tv
Vw
Vw
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
distthe radial distance
anglethe angle to rotate
lin_speedthe speed to rotate
Returns
0 on success, 1 othewrise
int VWDriveDone ( void  )

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
int VWDriveWait ( void  )

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
xstores the horizontal component
ystores the vertical component
phistores the turn angle
Returns
0 on success, 1 othewrise
int VWGetSpeed ( int *  linSpeed,
int *  angSpeed 
)

Obtains the current speeds.

Parameters
linspeedthe integer to store the linear speed
angSpeedthe integer to store the angular speed
Returns
0 on success, 1 othewrise
int VWInit ( )

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
xthe horizontal component
ythe vertical component
phithe turn angle
Returns
0 on success, 1 othewrise
int VWSetSpeed ( int  linSpeed,
int  angSpeed 
)

Sets the VW speed, angle.

Parameters
linSpeedthe straightline speed
angSpeedthe angular turning speed
Returns
0 on success, 1 othewrise
int VWStalled ( void  )

Checks to see if the vehicle is stalled.

Returns
0 on stalled, 1 othewrise
int VWStraight ( int  dist,
int  lin_speed 
)

Drives straight.

Parameters
distthe distance to travel
lin_speedthe speed to travel at
Returns
0 on success, 1 othewrise
int VWTurn ( int  angle,
int  ang_speed 
)

Turns the vehicle on the spot.

Parameters
anglethe angle to turn to
ang_speedthe speed to turn the angle
Returns
0 on success, 1 othewrise