Main Page | Data Structures | Directories | File List | Data Fields | Globals

rosetta.c File Reference

#include <config.h>
#include <string.h>
#include <math.h>
#include <cartcomm/cframe.h>
#include <drivers/drivers.h>
#include <recorder.h>

Include dependency graph for rosetta.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  state_t

Defines

#define DEG_TO_RAD   (3.14159 / 180.0)
#define CART_WHEEL_BASE   1.667

Functions

void * driver_rosetta_alloc (void)
 Construct a driver.
void driver_rosetta_free (void *data)
 Deconstruct the driver.
int driver_rosetta (cframe_t *cf, void *data)
 Drive the cart.


Define Documentation

#define CART_WHEEL_BASE   1.667
 

Definition at line 11 of file rosetta.c.

#define DEG_TO_RAD   (3.14159 / 180.0)
 

Definition at line 10 of file rosetta.c.

Referenced by driver_rosetta().


Function Documentation

int driver_rosetta cframe_t cframe,
void *  data
 

Drive the cart.

The driver is responsible for taking in the values the cframe and updating the cframe for transmission back to the cart. The process of updating is loosely called "driving".

Parameters:
cframe current communication frame from the cart
data private state information (obtained from driver_alloc())
Return values:
0 successful and unfinished
1 successful and finished
otherwise error

Definition at line 33 of file rosetta.c.

References cframe_t, cframe::cmd_irad, cframe::cmd_speed, state_t::counter, cframe::cur_mode, DEG_TO_RAD, and recorder_add().

Here is the call graph for this function:

void* driver_rosetta_alloc void   ) 
 

Construct a driver.

The driver usually will allocat some kind of data structure which maintains the state of the driver between calls to driver(). The driver can perform any other initialization needed during this call.

Returns:
private state information
See also:
driver_free()

Definition at line 17 of file rosetta.c.

References state_t::counter.

void driver_rosetta_free void *  data  ) 
 

Deconstruct the driver.

Free any memory and clean up any other resources held by the driver.

Parameters:
data private state information (obtained from driver_alloc())

Definition at line 29 of file rosetta.c.


Generated on Thu Sep 6 13:13:18 2007 for driver by  doxygen 1.3.9.1