Go to the source code of this file.
Data Structures | |
struct | koasound_s |
Defines | |
#define | RCVBUFSIZE 32 |
#define | soundbufsize 2048 |
Typedefs | |
typedef struct koasound_s | koasound_t |
Functions | |
void * | koa_init_task (void *arg) |
int | koa_net_init (int argc, char *argv[]) |
int | koa_net_camera (int argc, char *argv[]) |
int | koa_net_camera2 (int argc, char *argv[]) |
int | koa_net_bothcam (int argc, char *argv[]) |
int | koa_net_stop (int argc, char *argv[]) |
int | koa_net_setspeed (int argc, char *argv[]) |
int | net_exit (int argc, char *argv[]) |
int | koa_net_playsound (int argc, char *argv[]) |
void * | koa_sound_task (void *arg) |
void * | koa_sensor_task (void *arg) |
void | InitMotor (knet_dev_t *mot) |
int | main (int argc, char *argv[]) |
Variables | |
knet_dev_t * | koala |
int | right = 0 |
int | left = 0 |
int | left_limit_p = 100 |
int | left_limit_n = -100 |
int | right_limit_p = 100 |
int | right_limit_n = -100 |
knet_dev_t * | motor0 |
knet_dev_t * | motor1 |
knet_dev_t * | motor2 |
knet_dev_t * | motor3 |
int32_t | minpos0 |
int32_t | maxpos0 |
int32_t | minpos1 |
int32_t | maxpos1 |
int32_t | minpos2 |
int32_t | maxpos2 |
int32_t | minpos3 |
int32_t | maxpos3 |
const char * | soundlist [] |
const unsigned int | soundlist_size = sizeof(soundlist)/sizeof(char*) |
koasound_t * | lastsound = NULL |
koasound_t * | currentsound = NULL |
pthread_mutex_t | soundlock |
koala demo program (server side)
Definition in file koala_demo.c.
#define RCVBUFSIZE 32 |
Definition at line 27 of file koala_demo.c.
#define soundbufsize 2048 |
Koala Sound playing task
Definition at line 277 of file koala_demo.c.
Referenced by koa_sound_task().
typedef struct koasound_s koasound_t |
void InitMotor | ( | knet_dev_t * | mot | ) |
Pan-tilt motor initialization
Definition at line 443 of file koala_demo.c.
References kmot_ConfigurePID(), kmot_ResetError(), kmot_SetBlockedTime(), kmot_SetLimits(), kmot_SetMargin(), kmot_SetMode(), kmot_SetOptions(), kmot_SetSampleTime(), kmot_SetSpeedProfile(), kMotRegCurrent, kMotRegPos, kMotRegSpeed, kMotSWOptStopMotorBlk, and kMotSWOptWindup.
void* koa_init_task | ( | void * | arg | ) |
Koala Camera init task
Definition at line 65 of file koala_demo.c.
References kmot_ResetError(), kmot_SearchLimits(), kmot_SetBlockedTime(), maxpos0, maxpos1, maxpos2, maxpos3, minpos0, minpos1, minpos2, and minpos3.
Referenced by koa_net_init().
int koa_net_bothcam | ( | int | argc, | |
char * | argv[] | |||
) |
Definition at line 157 of file koala_demo.c.
References kmot_SetPoint(), kMotRegPos, minpos0, minpos1, minpos2, and minpos3.
Referenced by main().
int koa_net_camera | ( | int | argc, | |
char * | argv[] | |||
) |
Definition at line 100 of file koala_demo.c.
References kmot_SetPoint(), kMotRegPos, kMotRegPosProfile, minpos0, and minpos1.
Referenced by main().
int koa_net_camera2 | ( | int | argc, | |
char * | argv[] | |||
) |
Definition at line 131 of file koala_demo.c.
References kmot_SetPoint(), kMotRegPos, minpos2, and minpos3.
Referenced by main().
int koa_net_init | ( | int | argc, | |
char * | argv[] | |||
) |
Koala Network command callbacks
Definition at line 89 of file koala_demo.c.
References KB_ERROR_PTHREAD, KB_FATAL, and koa_init_task().
Referenced by main().
int koa_net_playsound | ( | int | argc, | |
char * | argv[] | |||
) |
Playing sound using the KoreMedia - generate a sound event
Definition at line 248 of file koala_demo.c.
References kb_alloc(), koasound_s::next, koasound_s::sound, and soundlist_size.
Referenced by main().
int koa_net_setspeed | ( | int | argc, | |
char * | argv[] | |||
) |
Definition at line 190 of file koala_demo.c.
References koa_setSpeed(), left, left_limit_n, left_limit_p, right, right_limit_n, and right_limit_p.
Referenced by main().
int koa_net_stop | ( | int | argc, | |
char * | argv[] | |||
) |
Definition at line 183 of file koala_demo.c.
References koa_setSpeed().
Referenced by main().
void* koa_sensor_task | ( | void * | arg | ) |
Koala Sensors reading and speed limiting task
Definition at line 360 of file koala_demo.c.
References koa_readProximity(), koa_setSpeed(), left, left_limit_n, left_limit_p, right, right_limit_n, and right_limit_p.
Referenced by main().
void* koa_sound_task | ( | void * | arg | ) |
Definition at line 278 of file koala_demo.c.
References FMT_CHUNK_HEADER::bit_per_sample, buf, WAV::fmt, kb_free, kb_snd_init(), kb_snd_open(), kb_snd_play(), kb_snd_setSampleRate(), kb_wav_close(), kb_wav_init(), kb_wav_open(), kb_wav_read_data(), FMT_CHUNK_HEADER::nb_channel, koasound_s::next, FMT_CHUNK_HEADER::sample_rate, koasound_s::sound, soundbufsize, and soundlist.
Referenced by main().
int main | ( | int | argc, | |
char * | argv[] | |||
) |
Definition at line 461 of file koala_demo.c.
References buf, DieWithError(), InitMotor(), kb_init(), kb_set_debug_level(), kmot_GetFWVersion(), KMOT_REVISION, kmot_SearchLimits(), kmot_SetBlockedTime(), KMOT_VERSION, KNET_BUS_ANY, knet_open(), koa_getOSVersion(), koa_net_bothcam(), koa_net_camera(), koa_net_camera2(), koa_net_init(), koa_net_playsound(), koa_net_setspeed(), koa_net_stop(), koa_sensor_task(), koa_setSpeed(), koa_sound_task(), ksock_add_command(), ksock_exec_command(), ksock_get_command(), ksock_init(), ksock_next_connection(), ksock_server_open(), list_command(), maxpos0, maxpos1, maxpos2, maxpos3, minpos0, minpos1, minpos2, minpos3, and RCVBUFSIZE.
int net_exit | ( | int | argc, | |
char * | argv[] | |||
) |
Definition at line 240 of file koala_demo.c.
koasound_t* currentsound = NULL |
Definition at line 58 of file koala_demo.c.
koasound_t* lastsound = NULL |
Definition at line 57 of file koala_demo.c.
int left = 0 |
Definition at line 31 of file koala_demo.c.
Referenced by handle_joyaxis(), koa_lrf_task(), koa_net_setspeed(), koa_sensor_task(), and thread().
int left_limit_n = -100 |
Definition at line 33 of file koala_demo.c.
Referenced by koa_net_setspeed(), and koa_sensor_task().
int left_limit_p = 100 |
Definition at line 32 of file koala_demo.c.
Referenced by koa_net_setspeed(), and koa_sensor_task().
int32_t maxpos0 |
int32_t maxpos1 |
int32_t maxpos2 |
int32_t maxpos3 |
int32_t minpos0 |
Definition at line 38 of file koala_demo.c.
Referenced by koa_init_task(), koa_net_bothcam(), koa_net_camera(), and main().
int32_t minpos1 |
Definition at line 38 of file koala_demo.c.
Referenced by koa_init_task(), koa_net_bothcam(), koa_net_camera(), and main().
int32_t minpos2 |
Definition at line 39 of file koala_demo.c.
Referenced by koa_init_task(), koa_net_bothcam(), koa_net_camera2(), and main().
int32_t minpos3 |
Definition at line 39 of file koala_demo.c.
Referenced by koa_init_task(), koa_net_bothcam(), koa_net_camera2(), and main().
Definition at line 37 of file koala_demo.c.
Definition at line 37 of file koala_demo.c.
int right = 0 |
Definition at line 30 of file koala_demo.c.
Referenced by handle_joyaxis(), koa_lrf_task(), koa_net_setspeed(), koa_sensor_task(), and thread().
int right_limit_n = -100 |
Definition at line 35 of file koala_demo.c.
Referenced by koa_net_setspeed(), and koa_sensor_task().
int right_limit_p = 100 |
Definition at line 34 of file koala_demo.c.
Referenced by koa_net_setspeed(), and koa_sensor_task().
const char* soundlist[] |
Initial value:
{ "sound1.wav", "sound2.wav", "sound3.wav", "sound4.wav", "sound5.wav" }
Definition at line 42 of file koala_demo.c.
Referenced by koa_sound_task().
const unsigned int soundlist_size = sizeof(soundlist)/sizeof(char*) |
pthread_mutex_t soundlock |
Definition at line 59 of file koala_demo.c.