KBR.c File Reference

Include dependency graph for KBR.c:

Go to the source code of this file.

Functions

static void ctrlc_handler (int sig)
int quit (int argc, char *argv[], void *data)
int stop (int argc, char *argv[], void *data)
int right (int argc, char *argv[], void *data)
int left (int argc, char *argv[], void *data)
int right3 (int argc, char *argv[], void *data)
int left3 (int argc, char *argv[], void *data)
int right2 (int argc, char *argv[], void *data)
int left2 (int argc, char *argv[], void *data)
int test (int argc, char *argv[], void *data)
int help (int argc, char *argv[], void *data)
int main (int argc, char *argv[])
void kmot_GetSpeedMultiplier (knet_dev_t *dev, unsigned short *mult)
void kmot_SetSpeedMultiplier (knet_dev_t *dev, int mode)

Variables

static int quitReq = 0
static int stopReq = 0
static int currentCommand = 0
static FILE * logfile
static knet_dev_tmotor
static pthread_t log_task
static kb_command_t cmds []
static char buf [1024]


Function Documentation

static void ctrlc_handler ( int  sig  )  [static]

Make sure the program terminate properly on a ctrl-c

Definition at line 43 of file KBR.c.

References stopReq.

int help ( int  argc,
char *  argv[],
void *  data 
)

Display a list of available commands.

Definition at line 453 of file koala_GoAutomation.c.

void kmot_GetSpeedMultiplier ( knet_dev_t dev,
unsigned short *  mult 
)

This function gets the pid speed multiplier.

Definition at line 158 of file kmot.c.

void kmot_SetSpeedMultiplier ( knet_dev_t dev,
int  mode 
)

kmot_SetSpeedMultiplier -

Parameters:
dev KNet Device Descriptor corresponding to the motor
prescale 

Definition at line 700 of file kmot.c.

int left ( int  argc,
char *  argv[],
void *  data 
)

Set a new open loop command for the current motor. The controller must be properly initialized. syntax: openloop <command>

Definition at line 93 of file KBR.c.

References kmot_GetMeasure(), kmot_SetMode(), kmot_SetPoint(), kMotMesCurrent, kMotModeStopMotor, and kMotRegOpenLoop.

Here is the call graph for this function:

int left2 ( int  argc,
char *  argv[],
void *  data 
)

Set a new open loop command for the current motor. The controller must be properly initialized. syntax: openloop <command>

Definition at line 152 of file KBR.c.

References kmot_SetMode(), kmot_SetPoint(), kMotModeStopMotor, and kMotRegOpenLoop.

Here is the call graph for this function:

int left3 ( int  argc,
char *  argv[],
void *  data 
)

Set a new open loop command for the current motor. The controller must be properly initialized. syntax: openloop <command>

Definition at line 125 of file KBR.c.

References kmot_SetMode(), kmot_SetPoint(), kMotModeStopMotor, and kMotRegOpenLoop.

Here is the call graph for this function:

int main ( int  argc,
char *  argv[] 
)

int quit ( int  argc,
char *  argv[],
void *  data 
)

Quit the program.

Definition at line 51 of file KBR.c.

References quitReq.

int right ( int  argc,
char *  argv[],
void *  data 
)

Set a new open loop command for the current motor. The controller must be properly initialized. syntax: openloop <command>

Definition at line 70 of file KBR.c.

References kmot_GetMeasure(), kmot_SetMode(), kmot_SetPoint(), kMotMesCurrent, kMotModeStopMotor, and kMotRegOpenLoop.

Here is the call graph for this function:

int right2 ( int  argc,
char *  argv[],
void *  data 
)

Definition at line 136 of file KBR.c.

References kmot_SetMode(), kmot_SetPoint(), kMotModeStopMotor, and kMotRegOpenLoop.

Here is the call graph for this function:

int right3 ( int  argc,
char *  argv[],
void *  data 
)

Definition at line 109 of file KBR.c.

References kmot_SetMode(), kmot_SetPoint(), kMotModeStopMotor, and kMotRegOpenLoop.

Here is the call graph for this function:

int stop ( int  argc,
char *  argv[],
void *  data 
)

Stop the current motor (set mode to stop motor mode).

Definition at line 59 of file KBR.c.

References kmot_SetMode(), and kMotModeStopMotor.

Here is the call graph for this function:

int test ( int  argc,
char *  argv[],
void *  data 
)

Set a new open loop command for the current motor. The controller must be properly initialized. syntax: openloop <command>

Definition at line 170 of file KBR.c.

References currentCommand, kmot_SetPoint(), and kMotRegOpenLoop.

Here is the call graph for this function:


Variable Documentation

char buf[1024] [static]

Main program to process the command line.

Definition at line 215 of file KBR.c.

kb_command_t cmds[] [static]

Initial value:

 {
  { "quit"            , 0 , 0 , quit } ,
  { "1"               , 2 , 2 , right } ,
  { "2"               , 2 , 2 , left } ,
  { "11"               , 0 , 0 , right2 } ,
  { "12"               , 0 , 0 , left2 } ,
  { "21"               , 0 , 0 , right3 } ,
  { "22"               , 0 , 0 , left3 } ,
  { "3"               , 0 , 0 , test } ,
  { "help"            , 0 , 0 ,  help } ,
  { NULL              , 0 , 0 , NULL }
}
The command table contains: command name : min number of args : max number of args : the function to call

Definition at line 184 of file KBR.c.

int currentCommand = 0 [static]

pthread_t log_task [static]

Definition at line 38 of file KBR.c.

Referenced by startlog(), and stoplog().

FILE* logfile [static]

Definition at line 36 of file KBR.c.

Referenced by kmot_log_task().

knet_dev_t* motor [static]

int quitReq = 0 [static]

Definition at line 32 of file KBR.c.

int stopReq = 0 [static]

Definition at line 33 of file KBR.c.

Referenced by ctrlc_handler(), and test().


Generated on Wed Dec 15 11:49:28 2010 for KoreBot Library by  doxygen 1.5.5