Go to the source code of this file.
Defines | |
#define | MAXBUFFERSIZE 100 |
#define | BR_IRGAIN 20 |
#define | fwSpeed 60 |
#define | MAXBUFFERSIZE 256 |
Functions | |
int | initMot (knet_dev_t *hDev) |
int | initKH3 (void) |
int | proxIR (int argc, char *argv[], void *data) |
int | ambIR (int argc, char *argv[], void *data) |
int | voltageBAT (int argc, char *argv[], void *data) |
int | tstampRST (int argc, char *argv[], void *data) |
int | revisionOS (int argc, char *argv[], void *data) |
int | configureOS (int argc, char *argv[], void *data) |
int | measureUS (int argc, char *argv[], void *data) |
int | motSpeed (int argc, char *argv[], void *data) |
int | motMove (int argc, char *argv[], void *data) |
int | motStop (int argc, char *argv[], void *data) |
int | braitenbergAvoidance (int argc, char *argv[], void *data) |
int | quit (int argc, char *argv[], void *data) |
int | help (int argc, char *argv[], void *data) |
int | main (int arc, char *argv[]) |
Variables | |
static int | quitReq = 0 |
static char | buf [1024] |
static knet_dev_t * | dsPic |
static knet_dev_t * | mot1 |
static knet_dev_t * | mot2 |
static kb_command_t | cmds [] |
#define BR_IRGAIN 20 |
#define fwSpeed 60 |
Definition at line 372 of file khepera3_test_loop.c.
#define MAXBUFFERSIZE 256 |
Definition at line 513 of file khepera3_test_loop.c.
#define MAXBUFFERSIZE 100 |
Definition at line 513 of file khepera3_test_loop.c.
int ambIR | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
ambIR retrieves ambiant ir measure using kb_khepera3.c library.
Definition at line 129 of file khepera3_test_loop.c.
References kh3_ambiant_ir(), and MAXBUFFERSIZE.
int braitenbergAvoidance | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Definition at line 374 of file khepera3_test_loop.c.
References BR_IRGAIN, fwSpeed, kb_gpio_get(), kh3_sendcommand(), kmot_GetMeasure(), kmot_SetPoint(), kMotMesSpeed, kMotRegSpeed, KNET_INT0, knet_llread(), and MAXBUFFERSIZE.
int configureOS | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
configureOS configures various parameters inside the kh3 firmware using kb_khepera3.c library.
1st | first param (argv[1]) is the index pointing in configuration array. | |
2nd | the second param (argv[2]) is the value to store where the index point at. |
Definition at line 243 of file khepera3_test_loop.c.
References kh3_configure_os(), and MAXBUFFERSIZE.
int help | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Display a list of available commands.
Definition at line 453 of file koala_GoAutomation.c.
int initKH3 | ( | void | ) |
initKH3 initialize various things in the kh3 then sequentialy open the various required handle to the three i2c devices on the khepera3 using knet_open from the knet.c libkorebot's modules. Finaly, this function initializes then configures the motor control unit.
Definition at line 81 of file khepera3_test_loop.c.
References initMot(), kh3_init(), KNET_BUS_I2C, and knet_open().
int initMot | ( | knet_dev_t * | hDev | ) |
initMot initializes then configures the motor control unit.
Definition at line 39 of file khepera3_test_loop.c.
References kmot_ConfigurePID(), kmot_ResetError(), kmot_SetBlockedTime(), kmot_SetLimits(), kmot_SetMargin(), kmot_SetMode(), kmot_SetOptions(), kmot_SetSampleTime(), kmot_SetSpeedProfile(), kMotModeIdle, kMotRegCurrent, kMotRegPos, kMotRegSpeed, kMotSWOptDirectionInv, kMotSWOptStopMotorBlk, and kMotSWOptWindup.
int main | ( | int | arc, | |
char * | argv[] | |||
) |
Definition at line 516 of file khepera3_test_loop.c.
References initKH3(), kh3_proximity_ir(), MAXBUFFERSIZE, and quitReq.
int measureUS | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
measureUS retrieves ultrasonic measure from a given transceiver.
1st | first param (argv[1]) is the us number to read from (1 to 5). |
Definition at line 266 of file khepera3_test_loop.c.
References kh3_measure_us(), and MAXBUFFERSIZE.
int motMove | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
motMove configures the motor controller position in the engine control unit.
1st | first param (argv[1]) is the motor1 position. | |
2nd | second param (argv[2]) is the motor2 position. |
Definition at line 336 of file khepera3_test_loop.c.
References kmot_SetPoint(), and kMotRegPos.
int motSpeed | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
motSpeed configures the motor controller speed in the engine control unit.
1st | first param (argv[1]) is the motor1 speed. | |
2nd | second param (argv[2]) is the motor2 speed. |
Definition at line 317 of file khepera3_test_loop.c.
References kmot_SetPoint(), and kMotRegSpeed.
int motStop | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
motStop stops the motor in the engine control unit.
none. |
Definition at line 353 of file khepera3_test_loop.c.
References kmot_SetMode(), and kMotModeStopMotor.
int proxIR | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
proxIR retrieves proximity ir measure using kb_khepera3.c library.
Definition at line 111 of file khepera3_test_loop.c.
References kh3_proximity_ir(), and MAXBUFFERSIZE.
int quit | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
int revisionOS | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
revisionOS retrieves the khepera3 os version using kb_khepera3.c library.
Definition at line 223 of file khepera3_test_loop.c.
References kh3_revision(), and MAXBUFFERSIZE.
int tstampRST | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
tstampRST resets the relative time stamp using kb_khepera3.c library.
Definition at line 210 of file khepera3_test_loop.c.
References kh3_reset_tstamp(), and MAXBUFFERSIZE.
int voltageBAT | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
voltageBAT retrieves the battery voltage using kb_khepera3.c library.
Definition at line 147 of file khepera3_test_loop.c.
References kh3_battery_voltage(), and MAXBUFFERSIZE.
char buf[1024] [static] |
Definition at line 20 of file khepera3_test_loop.c.
kb_command_t cmds[] [static] |
Initial value:
{ { "quit" , 0 , 0 , quit } , { "exit" , 0 , 0 , quit } , { "bye" , 0 , 0 , quit } , { "setcfg" , 2 , 2 , configureOS }, { "getrev" , 0 , 0 , revisionOS }, { "getbat" , 1 , 1 , voltageBAT }, { "rststamp" , 0 , 0 , tstampRST }, { "getambir" , 0 , 0 , ambIR }, { "getproxir" , 0 , 0 , proxIR }, { "getus" , 1 , 1 , measureUS }, { "setmotspeed" , 2 , 2 , motSpeed }, { "setmotmove" , 2 , 2 , motMove }, { "motstop" , 0 , 0 , motStop }, { "braiten" , 0 , 0 , braitenbergAvoidance}, { "help" , 0 , 0 , help } , { NULL , 0 , 0 , NULL } }
Definition at line 480 of file khepera3_test_loop.c.
knet_dev_t* dsPic [static] |
handle to the various khepera3 devices (knet socket, i2c mode)
Definition at line 25 of file khepera3_test_loop.c.
knet_dev_t* mot1 [static] |
Definition at line 26 of file khepera3_test_loop.c.
knet_dev_t* mot2 [static] |
Definition at line 27 of file khepera3_test_loop.c.
int quitReq = 0 [static] |
Definition at line 19 of file khepera3_test_loop.c.