Go to the source code of this file.
Data Structures | |
struct | koala_t |
Defines | |
#define | MAX_SENSOR_NUMBER 16 |
#define | RANGE (1024 / 2) |
#define | TIME_STEP 64 |
#define | RESET_BUT 65 |
#define | BAUDRATE B115200 |
Functions | |
static void | init (void) |
void * | thread (void *arg) |
int | thread_create (koala_t *koala) |
int | quit (int argc, char *argv[], void *data) |
int | start (int argc, char *argv[], void *data) |
int | stop (int argc, char *argv[], void *data) |
int | reset (int argc, char *argv[], void *data) |
int | gotogoal (int argc, char *argv[], void *data) |
int | askposition (int argc, char *argv[], void *data) |
void | handle_kill (int arg) |
int | help (int argc, char *argv[], void *data) |
int | main (int argc, char *argv[]) |
Variables | |
knet_dev_t * | BTComm |
knet_dev_t * | koala |
int | fd |
static int | quitReq = 0 |
static int | sensors [MAX_SENSOR_NUMBER] |
static float | matrix [16][2] |
static int | sensor_number |
static int | range |
static int | phase |
static int | position |
static int | goal |
static int | oldEncoder [2] |
static float | X |
static float | Y |
static float | Theta |
static int | Start |
koala_t | BTkoala_struct |
int | cmd_received = 0 |
static kb_command_t | cmds [] |
#define BAUDRATE B115200 |
#define MAX_SENSOR_NUMBER 16 |
#define RANGE (1024 / 2) |
#define RESET_BUT 65 |
#define TIME_STEP 64 |
Definition at line 24 of file koala_GoAutomation.c.
int askposition | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Return if the Koala is on the goal or not (1 yes, 0 no).
Definition at line 417 of file koala_GoAutomation.c.
int gotogoal | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
void handle_kill | ( | int | arg | ) |
Definition at line 428 of file koala_GoAutomation.c.
References koa_setSpeed().
int help | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Display a list of available commands.
Definition at line 453 of file koala_GoAutomation.c.
References fd, and kb_command_s::name.
static void init | ( | void | ) | [static] |
Definition at line 81 of file koala_GoAutomation.c.
References goal, koa_setPositionCounter(), oldEncoder, phase, position, RANGE, range, sensor_number, Start, Theta, X, and Y.
int main | ( | int | argc, | |
char * | argv[] | |||
) |
Definition at line 467 of file koala_GoAutomation.c.
References BAUDRATE, buf, fd, handle_kill(), IN, init(), kb_gpio_dir(), kb_gpio_function(), kb_gpio_init(), kb_init(), kb_parse_command(), kb_set_debug_level(), KNET_BUS_ANY, knet_open(), koa_getOSVersion(), koa_setSpeed(), quitReq, RESET_BUT, and thread_create().
int quit | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Quit the program.
Definition at line 348 of file koala_GoAutomation.c.
References fd, koa_setSpeed(), and quitReq.
int reset | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Reset the program.
Definition at line 382 of file koala_GoAutomation.c.
References fd, goal, koa_setPositionCounter(), oldEncoder, phase, position, Start, Theta, X, and Y.
int start | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Start the program.
Definition at line 360 of file koala_GoAutomation.c.
int stop | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
void* thread | ( | void * | arg | ) |
Definition at line 111 of file koala_GoAutomation.c.
References fd, goal, kb_gpio_get(), koa_readPosition(), koa_readProximity(), koa_setPositionCounter(), koa_setSpeed(), left, leftspeed, matrix, MAX_SENSOR_NUMBER, oldEncoder, phase, position, range, RESET_BUT, right, rightspeed, sensor_number, sensors, Start, Theta, X, and Y.
Referenced by thread_create().
int thread_create | ( | koala_t * | koala | ) |
Right Arm create
Definition at line 325 of file koala_GoAutomation.c.
References koala_t::busy, koala_t::cmdWait, koala_t::cmdWaitLock, koala_t::done, koala_t::state, thread(), and koala_t::thread.
Referenced by main().
Definition at line 31 of file koala_GoAutomation.c.
Definition at line 76 of file koala_GoAutomation.c.
int cmd_received = 0 |
kb_command_t cmds[] [static] |
Initial value:
{ { "R" , 0 , 0 , start }, { "Q" , 0 , 0 , quit }, { "S" , 0 , 0 , stop }, { "I" , 0 , 0 , reset }, { "G" , 0 , 0 , gotogoal }, { "P" , 0 , 0 , askposition }, { NULL , 0 , 0 , NULL } }
Definition at line 439 of file koala_GoAutomation.c.
int fd |
Definition at line 33 of file koala_GoAutomation.c.
int goal [static] |
Definition at line 59 of file koala_GoAutomation.c.
Referenced by gotogoal(), init(), reset(), start(), and thread().
Definition at line 32 of file koala_GoAutomation.c.
float matrix[16][2] [static] |
Initial value:
{ {-1, 15}, {-1, 5}, {-3, 4}, {-7, 17}, {0, 0}, {0, 0}, {0, 0}, {-10, -10}, {17, -1}, {5, -1}, {4,-3 }, {17, -7}, {0, 0}, {0, 0}, {0, 0}, {-10, -10} }
Definition at line 48 of file koala_GoAutomation.c.
Referenced by thread().
int oldEncoder[2] [static] |
int phase [static] |
Definition at line 57 of file koala_GoAutomation.c.
Referenced by gotogoal(), init(), reset(), start(), stop(), and thread().
int position [static] |
Definition at line 58 of file koala_GoAutomation.c.
Referenced by askposition(), gotogoal(), init(), kmot_log_task(), main(), reset(), and thread().
int quitReq = 0 [static] |
Definition at line 34 of file koala_GoAutomation.c.
int range [static] |
int sensor_number [static] |
int sensors[MAX_SENSOR_NUMBER] [static] |
int Start [static] |
float Theta [static] |
float X [static] |
float Y [static] |