R2R
|
utilities header More...
Go to the source code of this file.
Classes | |
struct | control_data_t |
Macros | |
#define | DECIMATION 10 |
#define | REFERENCE_DATA 10000 |
#define | BUFLEN 10000 |
Enumerations | |
enum | mode { IDLE, PWM, HOLD, TRACK, ITRACK, ITEST, ISENSE, ICALIB } |
Functions | |
void | setNclient (int n) |
Recieve number of values to store in position data arrays from client. More... | |
int | boundInt (int a, int n) |
Bounds a given input to a range of values. More... | |
int | maxInt (int a, int b) |
returns the large value of the two More... | |
mode | getMODE () |
Return the Mode of the robot. More... | |
void | setMODE (mode newMODE) |
Sets the Mode of the robot. More... | |
void | setN (void) |
Receive number N of samples to save into data buffer. More... | |
int | getN (void) |
Returns the number of samples. More... | |
void | write_refPos (int position, int index, int motor) |
Writes the reference position. More... | |
int | get_refPos (int index, int motor) |
Gets the reference position. More... | |
int | buffer_empty (void) |
Returns true if the buffer is empty. More... | |
int | buffer_full (void) |
Returns true if the buffer is full. More... | |
int | buffer_read_position (int motor) |
Reads position from the current buffer location. More... | |
int | buffer_read_u (int motor) |
Reads current value from current buffer location. More... | |
void | buffer_read_increment (void) |
Increments the buffer read index. More... | |
void | buffer_write (int M1_actPos, int M2_actPos, int M1_u, int M2_u) |
Write data to buffer. More... | |
void | send_data (void) |
Send data to client when it becomes available. More... | |
utilities header
This file contains the communication buffer and mode functions
enum mode |
Data structure containing the modes of the system
int boundInt | ( | int | a, |
int | n | ||
) |
Bounds a given input to a range of values.
int | a the input value |
int | n the range of the bounds |
int buffer_empty | ( | void | ) |
Returns true if the buffer is empty.
READ == WRITE
Void |
int buffer_full | ( | void | ) |
Returns true if the buffer is full.
(WRITE + 1) % BUFLEN == READ
Void |
void buffer_read_increment | ( | void | ) |
Increments the buffer read index.
Void |
int buffer_read_position | ( | int | motor | ) |
Reads position from the current buffer location.
This function assumes that buffer is not empty
int | motor the motor that is read from |
int buffer_read_u | ( | int | motor | ) |
Reads current value from current buffer location.
This function assumes that buffer is not empty
int | motor motor that is read from |
void buffer_write | ( | int | M1_actPos, |
int | M2_actPos, | ||
int | M1_u, | ||
int | M2_u | ||
) |
Write data to buffer.
int | M1_actPos motor 1 position |
int | M2_actPos motor 2 position |
int | M1_u motor 1 effort |
int | M1_u motor 2 effort |
int get_refPos | ( | int | index, |
int | motor | ||
) |
Gets the reference position.
int | index |
int | motor |
mode getMODE | ( | ) |
Return the Mode of the robot.
mode | operating mode of the robot |
int getN | ( | void | ) |
Returns the number of samples.
Void |
int maxInt | ( | int | a, |
int | b | ||
) |
returns the large value of the two
int | a one input value |
int | b the other input value |
void send_data | ( | void | ) |
Send data to client when it becomes available.
Void |
void setMODE | ( | mode | newMODE | ) |
Sets the Mode of the robot.
The avaliable modes are IDLE, HOLD, TRACK, PWM, ISENSE, ITEST, ITRACK, ICALIB
mode | operating mode of the robot |
void setN | ( | void | ) |
Receive number N of samples to save into data buffer.
Void |
void setNclient | ( | int | n | ) |
Recieve number of values to store in position data arrays from client.
Void |
void write_refPos | ( | int | position, |
int | index, | ||
int | motor | ||
) |
Writes the reference position.
int | position |
int | index |
int | motor |