From f3113146fd2ed6c8bc385116d9e761700646ec92 Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Tue, 30 Aug 2016 08:14:53 +0200 Subject: [PATCH 1/8] new os lib version --- source/os/release/include/shell.h | 1 + ...bkosmos-arm-stm32f4-discovery-0.1.6.257.a} | Bin 494154 -> 494394 bytes .../release/libkosmos-arm-stm32f4-discovery.a | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) rename source/os/release/{libkosmos-arm-stm32f4-discovery-0.1.5.250.a => libkosmos-arm-stm32f4-discovery-0.1.6.257.a} (92%) diff --git a/source/os/release/include/shell.h b/source/os/release/include/shell.h index c242e8d..1b176ee 100644 --- a/source/os/release/include/shell.h +++ b/source/os/release/include/shell.h @@ -19,5 +19,6 @@ struct command { int shell_init(const struct driver *shell_device); int shell_add_command(struct command *command); +int shell_write(const char *buffer, unsigned int len); #endif /* SOURCE_FIRMWARE_KERNEL_INTERFACE_SHELL_H_ */ diff --git a/source/os/release/libkosmos-arm-stm32f4-discovery-0.1.5.250.a b/source/os/release/libkosmos-arm-stm32f4-discovery-0.1.6.257.a similarity index 92% rename from source/os/release/libkosmos-arm-stm32f4-discovery-0.1.5.250.a rename to source/os/release/libkosmos-arm-stm32f4-discovery-0.1.6.257.a index c1d60ea73af1220244faa7c52aada285b75a773f..f39b35778f1267fc9d541792d39a78e4fb9358bd 100644 GIT binary patch delta 7060 zcmc(k4@_0p9mjv?-uvD`RQdqrJ;36tFm0jYyZ8OOPd3mrqlr|-+M=Xwd5ViRrZ&Yyb)@$qj0 zedP0g_k7Rq{Lb(E?l}h|pX^OL(U?{@!wC9AdQkIveO~tI|Lyf^;h2H`}#iD06h#{{{R#fgLd4i9}}dw z-@%AU?E;Bm*bk$%Y9mNF3B$8E6C|6J)PDfRKw(tvohcxVmilav`Y`$$tu-JG#hG7% zG}c@(c7t@~2gDfVR26=QC!w+~f1>}LeJ0IjR!JvWue0^-V zbOYqkVz2>UZU4bA*yM^UK``wEC=bi*>!3sMT&k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5&R_0$(mDN;)+pMld$Z5Uy zTiJQCp%^2p>3jGK6Vm9obQeG_lUV@OOfCRuWO5 z{uVcmSkJ7$D=qhn@>ka361-$ingf73f=ugN30^ZNOq)*LoTuS6%O9rA?W{>*#VWR} zrxH#h=@29uWt(%%`8o diff --git a/source/os/release/libkosmos-arm-stm32f4-discovery.a b/source/os/release/libkosmos-arm-stm32f4-discovery.a index f542b68..6ab1828 120000 --- a/source/os/release/libkosmos-arm-stm32f4-discovery.a +++ b/source/os/release/libkosmos-arm-stm32f4-discovery.a @@ -1 +1 @@ -libkosmos-arm-stm32f4-discovery-0.1.5.250.a \ No newline at end of file +libkosmos-arm-stm32f4-discovery-0.1.6.257.a \ No newline at end of file From d468cc0b222f77ef1c2015447ee5bb3733e85122 Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Tue, 30 Aug 2016 08:41:02 +0200 Subject: [PATCH 2/8] shell command for application version added --- source/application/shell_commands.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/source/application/shell_commands.c b/source/application/shell_commands.c index 0cb89f8..2be40f6 100644 --- a/source/application/shell_commands.c +++ b/source/application/shell_commands.c @@ -6,6 +6,7 @@ */ #include #include +#include #include "list.h" #include "driver.h" @@ -72,6 +73,7 @@ static struct command drive_turn_right = { int shell_commands_init(void) { + shell_add_command(&cmd_app_version); shell_add_command(&drive_forward); shell_add_command(&drive_backward); shell_add_command(&drive_boost); @@ -79,7 +81,6 @@ int shell_commands_init(void) shell_add_command(&drive_halt); shell_add_command(&drive_turn_left); shell_add_command(&drive_turn_right); - shell_add_command(&cmd_app_version); return 0; } @@ -162,15 +163,15 @@ static void *drive_backward_cb(const char *param) static void *app_version(const char *param) { -#if 0 char *greeter = "engine_control version: "; - drv_write(shell_object.shell_device, greeter, strlen(greeter)); - drv_write(shell_object.shell_device, MAJOR_VERSION, strlen(MAJOR_VERSION)); - drv_write(shell_object.shell_device, ".", 1); - drv_write(shell_object.shell_device, MINOR_VERSION, strlen(MINOR_VERSION)); - drv_write(shell_object.shell_device, ".", 1); - drv_write(shell_object.shell_device, BUILD_NUMBER, strlen(BUILD_NUMBER)); -#endif + shell_write(greeter, strlen(greeter)); + shell_write(MAJOR_VERSION, strlen(MAJOR_VERSION)); + shell_write(".", 1); + shell_write(MINOR_VERSION, strlen(MINOR_VERSION)); + shell_write(".", 1); + shell_write(BUILD_NUMBER, strlen(BUILD_NUMBER)); + shell_write("\r\n", 2); + return NULL; } From 33a8e8ae2d49f4867599755a3b96a2165018d35b Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Tue, 30 Aug 2016 10:07:47 +0200 Subject: [PATCH 3/8] engine/drive ctrl functionality splitted/reordered --- source/application/drive_ctrl.c | 225 +++++++++++------------ source/application/engine_ctrl.c | 134 ++++++++++++++ source/application/include/drive_ctrl.h | 16 +- source/application/include/engine_ctrl.h | 22 +++ source/application/include/engines.h | 5 - source/application/shell_commands.c | 97 +--------- 6 files changed, 281 insertions(+), 218 deletions(-) create mode 100644 source/application/engine_ctrl.c create mode 100644 source/application/include/engine_ctrl.h diff --git a/source/application/drive_ctrl.c b/source/application/drive_ctrl.c index 421f18b..2bf6a34 100644 --- a/source/application/drive_ctrl.c +++ b/source/application/drive_ctrl.c @@ -5,149 +5,146 @@ * Author: tkl */ +#include #include +#include +#include +#include +#include "queue.h" +#include "stack.h" +#include "kernel.h" #include "driver.h" -#include "board_devices.h" -#include "engines.h" +#include "engine_ctrl.h" #include "drive_ctrl.h" -struct drive_ctrl { - struct engine_ctrl *left_forward; - struct engine_ctrl *left_backward; - struct engine_ctrl *right_forward; - struct engine_ctrl *right_backward; -}; - -struct drive_ctrl_object { - unsigned int target_speed; - unsigned int turn_speed; - unsigned int current_speed; -}; - -static struct drive_ctrl drive_ctrl = { - .left_forward = &left_forward, - .left_backward = &left_backward, - .right_forward = &right_forward, - .right_backward = &right_backward, -}; - -static struct drive_ctrl_object drive_ctrl_object = { - .target_speed = 80, /* % */ - .turn_speed = 40, - .current_speed = 0, /* % */ -}; - int drive_ctrl_init(void) { - unsigned int duty = 0; - - /* open enable pins */ - drv_open(drive_ctrl.left_forward->enable); - drv_write(drive_ctrl.left_forward->enable, "0", 1); - drv_open(drive_ctrl.left_backward->enable); - drv_write(drive_ctrl.left_backward->enable, "0", 1); - drv_open(drive_ctrl.right_forward->enable); - drv_write(drive_ctrl.right_forward->enable, "0", 1); - drv_open(drive_ctrl.right_backward->enable); - drv_write(drive_ctrl.right_backward->enable, "0", 1); - - /* open pwm's */ - drv_open(drive_ctrl.left_backward->pwm); - drv_ioctl(drive_ctrl.left_backward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&duty); - drv_open(drive_ctrl.left_forward->pwm); - drv_ioctl(drive_ctrl.left_forward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&duty); - drv_open(drive_ctrl.right_backward->pwm); - drv_ioctl(drive_ctrl.right_backward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&duty); - drv_open(drive_ctrl.right_forward->pwm); - drv_ioctl(drive_ctrl.right_forward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&duty); - - /* enable enable pins */ - drv_write(drive_ctrl.left_forward->enable, "1", 1); - drv_write(drive_ctrl.left_backward->enable, "1", 1); - drv_write(drive_ctrl.right_forward->enable, "1", 1); - drv_write(drive_ctrl.right_backward->enable, "1", 1); - - return 0; + return engine_ctrl_init(); } -static unsigned int calc_speed_front(int speed_percent) +int drive_ctrl_turn_right(void) { - unsigned int speed_front = 0; - if(speed_percent > 0) { - if(speed_percent > 100) - speed_front = 100; - else - speed_front = (unsigned int) speed_percent; + drive_ctrl_halt(); + int turn_speed = engine_ctrl_get_turn_speed_value(); + for(int i = 0; i < turn_speed; i++) { + engine_ctrl_set_speed_left(i); + engine_ctrl_set_speed_right(-1 * i); + sleep_ms(10); } - return speed_front; + + return 0; } -static unsigned int calc_speed_back(int speed_percent) +int drive_ctrl_turn_left(void) { - unsigned int speed_back = 0; - if(speed_percent < 0) { - if(speed_percent < -100) - speed_back = 100; - else - speed_back = (unsigned int) abs(speed_percent); + drive_ctrl_halt(); + int turn_speed = engine_ctrl_get_turn_speed_value(); + for(int i = 0; i < turn_speed; i++) { + engine_ctrl_set_speed_right(i); + engine_ctrl_set_speed_left(-1 * i); + sleep_ms(10); } - return speed_back; -} - -int drive_ctrl_set_speed_left(int speed_percent) -{ - unsigned int front_speed = calc_speed_front(speed_percent); - unsigned int back_speed = calc_speed_back(speed_percent); - int ret = drv_ioctl(drive_ctrl.right_forward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&front_speed); - ret |= drv_ioctl(drive_ctrl.left_backward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&back_speed); - - return ret; -} - -int drive_ctrl_set_speed_right(int speed_percent) -{ - unsigned int front_speed = calc_speed_front(speed_percent); - unsigned int back_speed = calc_speed_back(speed_percent); - int ret = drv_ioctl(drive_ctrl.left_forward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&front_speed); - ret |= drv_ioctl(drive_ctrl.right_backward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&back_speed); - - return ret; -} - -int drive_ctrl_set_target_speed_value(int speed_percent) -{ - drive_ctrl_object.target_speed = speed_percent; return 0; } -int drive_ctrl_get_target_speed_value(void) +int drive_ctrl_boost(void) { - return drive_ctrl_object.target_speed; -} - -int drive_ctrl_set_current_speed_value(int speed_percent) -{ - drive_ctrl_object.current_speed = speed_percent; + int speed = engine_ctrl_get_target_speed_value(); + speed += 10; + engine_ctrl_set_target_speed_value(speed); + engine_ctrl_set_speed_left(speed); + engine_ctrl_set_speed_right(speed); return 0; } -int drive_ctrl_get_current_speed_value(void) +int drive_ctrl_retard(void) { - return drive_ctrl_object.current_speed; -} - -int drive_ctrl_set_turn_speed_value(int speed_percent) -{ - drive_ctrl_object.turn_speed = speed_percent; + int speed = engine_ctrl_get_target_speed_value(); + speed -= 10; + engine_ctrl_set_target_speed_value(speed); + engine_ctrl_set_speed_left(speed); + engine_ctrl_set_speed_right(speed); return 0; } -int drive_ctrl_get_turn_speed_value(void) +int drive_ctrl_halt(void) { - return drive_ctrl_object.turn_speed; + int current_speed = engine_ctrl_get_current_speed_value(); + if(current_speed > 0) { + for(int i = current_speed; i > 0; i--) { + engine_ctrl_set_current_speed_value(i); + engine_ctrl_set_speed_left(i); + engine_ctrl_set_speed_right(i); + sleep_ms(10); + } + } + else { + for(int i = current_speed; i < 0; i++) { + engine_ctrl_set_current_speed_value(i); + engine_ctrl_set_speed_left(i); + engine_ctrl_set_speed_right(i); + sleep_ms(10); + } + } + + return 0; +} + +int drive_ctrl_forward(void) +{ + int target_speed = engine_ctrl_get_target_speed_value(); + int current_speed = engine_ctrl_get_current_speed_value(); + if(target_speed < 0) + target_speed = abs(target_speed); + engine_ctrl_set_target_speed_value(target_speed); + if(current_speed < target_speed) { + for(int i = current_speed; i < target_speed; i++) { + engine_ctrl_set_current_speed_value(i); + engine_ctrl_set_speed_left(i); + engine_ctrl_set_speed_right(i); + sleep_ms(10); + } + } + else { + for(int i = current_speed; i > target_speed; i--) { + engine_ctrl_set_current_speed_value(i); + engine_ctrl_set_speed_left(i); + engine_ctrl_set_speed_right(i); + sleep_ms(10); + } + } + + return 0; +} + +int drive_ctrl_backward(void) +{ + int target_speed = engine_ctrl_get_target_speed_value(); + int current_speed = engine_ctrl_get_current_speed_value(); + if(target_speed > 0) + target_speed *= -1; + engine_ctrl_set_target_speed_value(target_speed); + if(current_speed > target_speed) { + for(int i = current_speed; i > target_speed; i--) { + engine_ctrl_set_current_speed_value(i); + engine_ctrl_set_speed_left(i); + engine_ctrl_set_speed_right(i); + sleep_ms(10); + } + } + else { + for(int i = current_speed; i < target_speed; i++) { + engine_ctrl_set_current_speed_value(i); + engine_ctrl_set_speed_left(i); + engine_ctrl_set_speed_right(i); + sleep_ms(10); + } + } + + return 0; } diff --git a/source/application/engine_ctrl.c b/source/application/engine_ctrl.c new file mode 100644 index 0000000..bb2f3c7 --- /dev/null +++ b/source/application/engine_ctrl.c @@ -0,0 +1,134 @@ +/* + * engine_ctrl.c + * + * Created on: Aug 30, 2016 + * Author: tkl + */ +#include + +#include "board_devices.h" +#include "driver.h" +#include "engines.h" + +struct drive_ctrl { + struct engine_ctrl *left_forward; + struct engine_ctrl *left_backward; + struct engine_ctrl *right_forward; + struct engine_ctrl *right_backward; +}; + +struct drive_ctrl_object { + unsigned int target_speed; + unsigned int turn_speed; + unsigned int current_speed; +}; + +static struct drive_ctrl drive_ctrl = { + .left_forward = &left_forward, + .left_backward = &left_backward, + .right_forward = &right_forward, + .right_backward = &right_backward, +}; + +static struct drive_ctrl_object drive_ctrl_object = { + .target_speed = 100,/* % */ + .turn_speed = 40, /* % */ + .current_speed = 0, /* % */ +}; + +int engine_ctrl_init(void) +{ + unsigned int duty = 0; + + /* open pwm's */ + drv_open(drive_ctrl.left_backward->pwm); + drv_ioctl(drive_ctrl.left_backward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&duty); + drv_open(drive_ctrl.left_forward->pwm); + drv_ioctl(drive_ctrl.left_forward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&duty); + drv_open(drive_ctrl.right_backward->pwm); + drv_ioctl(drive_ctrl.right_backward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&duty); + drv_open(drive_ctrl.right_forward->pwm); + drv_ioctl(drive_ctrl.right_forward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&duty); + + return 0; +} + +static unsigned int calc_speed_front(int speed_percent) +{ + unsigned int speed_front = 0; + if(speed_percent > 0) { + if(speed_percent > 100) + speed_front = 100; + else + speed_front = (unsigned int) speed_percent; + } + return speed_front; +} + +static unsigned int calc_speed_back(int speed_percent) +{ + unsigned int speed_back = 0; + if(speed_percent < 0) { + if(speed_percent < -100) + speed_back = 100; + else + speed_back = (unsigned int) abs(speed_percent); + } + return speed_back; +} + +int engine_ctrl_set_speed_left(int speed_percent) +{ + unsigned int front_speed = calc_speed_front(speed_percent); + unsigned int back_speed = calc_speed_back(speed_percent); + int ret = drv_ioctl(drive_ctrl.right_forward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&front_speed); + ret |= drv_ioctl(drive_ctrl.left_backward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&back_speed); + + return ret; +} + +int engine_ctrl_set_speed_right(int speed_percent) +{ + unsigned int front_speed = calc_speed_front(speed_percent); + unsigned int back_speed = calc_speed_back(speed_percent); + int ret = drv_ioctl(drive_ctrl.left_forward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&front_speed); + ret |= drv_ioctl(drive_ctrl.right_backward->pwm, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&back_speed); + + return ret; +} + +int engine_ctrl_set_target_speed_value(int speed_percent) +{ + drive_ctrl_object.target_speed = speed_percent; + + return 0; +} + +int engine_ctrl_get_target_speed_value(void) +{ + return drive_ctrl_object.target_speed; +} + +int engine_ctrl_set_current_speed_value(int speed_percent) +{ + drive_ctrl_object.current_speed = speed_percent; + + return 0; +} + +int engine_ctrl_get_current_speed_value(void) +{ + return drive_ctrl_object.current_speed; +} + +int drive_ctrl_set_turn_speed_value(int speed_percent) +{ + drive_ctrl_object.turn_speed = speed_percent; + + return 0; +} + +int engine_ctrl_get_turn_speed_value(void) +{ + return drive_ctrl_object.turn_speed; +} diff --git a/source/application/include/drive_ctrl.h b/source/application/include/drive_ctrl.h index 2672ecc..8edab17 100644 --- a/source/application/include/drive_ctrl.h +++ b/source/application/include/drive_ctrl.h @@ -10,14 +10,12 @@ int drive_ctrl_init(void); -int drive_ctrl_set_speed_left(int speed_percent); -int drive_ctrl_set_speed_right(int speed_percent); -int drive_ctrl_set_target_speed_value(int speed_percent); -int drive_ctrl_get_target_speed_value(void); -int drive_ctrl_set_current_speed_value(int speed_percent); -int drive_ctrl_get_current_speed_value(void); -int drive_ctrl_set_turn_speed_value(int speed_percent); -int drive_ctrl_get_turn_speed_value(void); - +int drive_ctrl_turn_right(void); +int drive_ctrl_turn_left(void); +int drive_ctrl_boost(void); +int drive_ctrl_retard(void); +int drive_ctrl_halt(void); +int drive_ctrl_forward(void); +int drive_ctrl_backward(void); #endif /* SOURCE_APPLICATION_INCLUDE_DRIVE_CTRL_H_ */ diff --git a/source/application/include/engine_ctrl.h b/source/application/include/engine_ctrl.h new file mode 100644 index 0000000..245451f --- /dev/null +++ b/source/application/include/engine_ctrl.h @@ -0,0 +1,22 @@ +/* + * engine_ctrl.h + * + * Created on: Aug 30, 2016 + * Author: tkl + */ + +#ifndef SOURCE_APPLICATION_INCLUDE_ENGINE_CTRL_H_ +#define SOURCE_APPLICATION_INCLUDE_ENGINE_CTRL_H_ + +int engine_ctrl_init(void); + +int engine_ctrl_set_speed_left(int speed_percent); +int engine_ctrl_set_speed_right(int speed_percent); +int engine_ctrl_set_target_speed_value(int speed_percent); +int engine_ctrl_get_target_speed_value(void); +int engine_ctrl_set_current_speed_value(int speed_percent); +int engine_ctrl_get_current_speed_value(void); +int engine_ctrl_set_turn_speed_value(int speed_percent); +int engine_ctrl_get_turn_speed_value(void); + +#endif /* SOURCE_APPLICATION_INCLUDE_ENGINE_CTRL_H_ */ diff --git a/source/application/include/engines.h b/source/application/include/engines.h index 6a955ed..cc6d7ed 100644 --- a/source/application/include/engines.h +++ b/source/application/include/engines.h @@ -10,27 +10,22 @@ struct engine_ctrl { const struct driver *pwm; - const struct driver *enable; }; static struct engine_ctrl left_forward = { .pwm = &pwm_4, - .enable = &gpio_c2, }; static struct engine_ctrl right_backward = { .pwm = &pwm_3, - .enable = &gpio_c3, }; static struct engine_ctrl right_forward = { .pwm = &pwm_2, - .enable = &gpio_c0, }; static struct engine_ctrl left_backward = { .pwm = &pwm_1, - .enable = &gpio_c1, }; #endif /* SOURCE_APPLICATION_INCLUDE_ENGINES_H_ */ diff --git a/source/application/shell_commands.c b/source/application/shell_commands.c index 1d02284..b8100ba 100644 --- a/source/application/shell_commands.c +++ b/source/application/shell_commands.c @@ -92,126 +92,43 @@ int shell_commands_init(void) static void *drive_turn_right_cb(const char *param) { - drive_halt_cb(NULL); - int turn_speed = drive_ctrl_get_turn_speed_value(); - for(int i = 0; i < turn_speed; i++) { - drive_ctrl_set_speed_left(i); - drive_ctrl_set_speed_right(-1 * i); - sleep_ms(10); - } - + drive_ctrl_turn_right(); return NULL; } static void *drive_turn_left_cb(const char *param) { - drive_halt_cb(NULL); - int turn_speed = drive_ctrl_get_turn_speed_value(); - for(int i = 0; i < turn_speed; i++) { - drive_ctrl_set_speed_right(i); - drive_ctrl_set_speed_left(-1 * i); - sleep_ms(10); - } - + drive_ctrl_turn_left(); return NULL; } static void *drive_boost_cb(const char *param) { - int speed = drive_ctrl_get_target_speed_value(); - speed += 10; - drive_ctrl_set_target_speed_value(speed); - drive_ctrl_set_speed_left(speed); - drive_ctrl_set_speed_right(speed); - + drive_ctrl_boost(); return NULL; } static void *drive_retard_cb(const char *param) { - int speed = drive_ctrl_get_target_speed_value(); - speed -= 10; - drive_ctrl_set_target_speed_value(speed); - drive_ctrl_set_speed_left(speed); - drive_ctrl_set_speed_right(speed); - + drive_ctrl_retard(); return NULL; } static void *drive_halt_cb(const char *param) { - int current_speed = drive_ctrl_get_current_speed_value(); - if(current_speed > 0) { - for(int i = current_speed; i > 0; i--) { - drive_ctrl_set_current_speed_value(i); - drive_ctrl_set_speed_left(i); - drive_ctrl_set_speed_right(i); - sleep_ms(10); - } - } - else { - for(int i = current_speed; i < 0; i++) { - drive_ctrl_set_current_speed_value(i); - drive_ctrl_set_speed_left(i); - drive_ctrl_set_speed_right(i); - sleep_ms(10); - } - } - + drive_ctrl_halt(); return NULL; } static void *drive_forward_cb(const char *param) { - int target_speed = drive_ctrl_get_target_speed_value(); - int current_speed = drive_ctrl_get_current_speed_value(); - if(target_speed < 0) - target_speed = abs(target_speed); - drive_ctrl_set_target_speed_value(target_speed); - if(current_speed < target_speed) { - for(int i = current_speed; i < target_speed; i++) { - drive_ctrl_set_current_speed_value(i); - drive_ctrl_set_speed_left(i); - drive_ctrl_set_speed_right(i); - sleep_ms(10); - } - } - else { - for(int i = current_speed; i > target_speed; i--) { - drive_ctrl_set_current_speed_value(i); - drive_ctrl_set_speed_left(i); - drive_ctrl_set_speed_right(i); - sleep_ms(10); - } - } - + drive_ctrl_forward(); return NULL; } static void *drive_backward_cb(const char *param) { - int target_speed = drive_ctrl_get_target_speed_value(); - int current_speed = drive_ctrl_get_current_speed_value(); - if(target_speed > 0) - target_speed *= -1; - drive_ctrl_set_target_speed_value(target_speed); - if(current_speed > target_speed) { - for(int i = current_speed; i > target_speed; i--) { - drive_ctrl_set_current_speed_value(i); - drive_ctrl_set_speed_left(i); - drive_ctrl_set_speed_right(i); - sleep_ms(10); - } - } - else { - for(int i = current_speed; i < target_speed; i++) { - drive_ctrl_set_current_speed_value(i); - drive_ctrl_set_speed_left(i); - drive_ctrl_set_speed_right(i); - sleep_ms(10); - } - } - + drive_ctrl_backward(); return NULL; } From 761d3ab0a662e0c99c3fceebe10b7d4c0e31e5a2 Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Tue, 30 Aug 2016 13:37:40 +0200 Subject: [PATCH 4/8] collision detection system --- source/application/collision_ctrl.c | 90 +++++++++++++++++++++ source/application/include/collision_ctrl.h | 14 ++++ source/application/include/sensor_data.h | 14 ++++ source/application/main.c | 6 +- source/application/sensor_data.c | 65 +++++++++++++++ source/application/shell_commands.c | 28 +++++++ 6 files changed, 216 insertions(+), 1 deletion(-) create mode 100644 source/application/collision_ctrl.c create mode 100644 source/application/include/collision_ctrl.h create mode 100644 source/application/include/sensor_data.h create mode 100644 source/application/sensor_data.c diff --git a/source/application/collision_ctrl.c b/source/application/collision_ctrl.c new file mode 100644 index 0000000..4b878d4 --- /dev/null +++ b/source/application/collision_ctrl.c @@ -0,0 +1,90 @@ +/* + * collision_ctrl.c + * + * Created on: Aug 30, 2016 + * Author: tkl + */ + +#include +#include +#include +#include +#include +#include + +#include "board_devices.h" +#include "queue.h" +#include "list.h" +#include "stack.h" +#include "kernel.h" +#include "driver.h" +#include "shell.h" +#include "drive_ctrl.h" +#include "engine_ctrl.h" + +#pragma pack(push) +#pragma pack(1) +struct collision_ctrl_object { + int distance_mm; +}; +#pragma pack(pop) + +struct collision_ctrl_object collision_ctrl_object; +struct thread_context collision_ctrl_ctx; +stack_t collision_ctrl_stack[256]; + +static void collision_ctrl_loop(void *arg) +{ + drv_open(&pwm5_c2); /* trigger pwm */ + drv_open(&pwm2_c4); /* read pwm */ + while(1) { + int pulse_ns = drv_ioctl(&pwm2_c4, IOCTL_PWM_GET_PULSE_WIDTH_NS, NULL); + collision_ctrl_object.distance_mm = 343 * pulse_ns / 1000 / 2; + if(collision_ctrl_object.distance_mm < 300) { + char print_buffer[50]; + if(engine_ctrl_get_current_speed_value() != 0) { + drive_ctrl_halt(); + sprintf(print_buffer, "collision detected (%dmm)...\r\n", collision_ctrl_object.distance_mm); + shell_write(print_buffer, strlen(print_buffer)); + sprintf(print_buffer, "going back...\r\n"); + shell_write(print_buffer, strlen(print_buffer)); + drive_ctrl_backward(); + sleep_ms(3000); /* todo: randomize */ + drive_ctrl_halt(); + + sprintf(print_buffer, "start turning...\r\n"); + shell_write(print_buffer, strlen(print_buffer)); + drive_ctrl_turn_left(); + sleep_ms(3000); + drive_ctrl_halt(); + + sprintf(print_buffer, "restart forward...\r\n"); + shell_write(print_buffer, strlen(print_buffer)); + drive_ctrl_forward(); + } + else { + sprintf(print_buffer, "collision detected while not driving 8(\r\n"); + shell_write(print_buffer, strlen(print_buffer)); + } + } + sleep_ms(1); + } +} + +int collision_ctrl_init(void) +{ + thread_create( + &collision_ctrl_ctx, + collision_ctrl_stack, + sizeof(collision_ctrl_stack) / sizeof(stack_t), + collision_ctrl_loop, + NULL, + THREAD_PRIO_LOW); + + return 0; +} + +int collision_ctrl_get_distance_mm(void) +{ + return collision_ctrl_object.distance_mm; +} diff --git a/source/application/include/collision_ctrl.h b/source/application/include/collision_ctrl.h new file mode 100644 index 0000000..9275593 --- /dev/null +++ b/source/application/include/collision_ctrl.h @@ -0,0 +1,14 @@ +/* + * collision_ctrl.h + * + * Created on: Aug 30, 2016 + * Author: tkl + */ + +#ifndef SOURCE_APPLICATION_INCLUDE_COLLISION_CTRL_H_ +#define SOURCE_APPLICATION_INCLUDE_COLLISION_CTRL_H_ + +int collision_ctrl_init(void); +int collision_ctrl_get_distance_mm(void); + +#endif /* SOURCE_APPLICATION_INCLUDE_COLLISION_CTRL_H_ */ diff --git a/source/application/include/sensor_data.h b/source/application/include/sensor_data.h new file mode 100644 index 0000000..ed4e245 --- /dev/null +++ b/source/application/include/sensor_data.h @@ -0,0 +1,14 @@ +/* + * sensor_data.h + * + * Created on: Aug 30, 2016 + * Author: tkl + */ + +#ifndef SOURCE_APPLICATION_INCLUDE_SENSOR_DATA_H_ +#define SOURCE_APPLICATION_INCLUDE_SENSOR_DATA_H_ + +int sensor_data_init(void); +int sensor_data_sys_msg(bool state); + +#endif /* SOURCE_APPLICATION_INCLUDE_SENSOR_DATA_H_ */ diff --git a/source/application/main.c b/source/application/main.c index 4544360..cd70b1c 100644 --- a/source/application/main.c +++ b/source/application/main.c @@ -10,12 +10,16 @@ #include "shell.h" #include "shell_commands.h" #include "drive_ctrl.h" +#include "collision_ctrl.h" +#include "sensor_data.h" int main(void) { - drive_ctrl_init(); shell_init(&uart_1); shell_commands_init(); + drive_ctrl_init(); + collision_ctrl_init(); + sensor_data_init(); while(1) { sleep_ms(1000); diff --git a/source/application/sensor_data.c b/source/application/sensor_data.c new file mode 100644 index 0000000..7b72a50 --- /dev/null +++ b/source/application/sensor_data.c @@ -0,0 +1,65 @@ +/* + * sensor_data.c + * + * Created on: Aug 30, 2016 + * Author: tkl + */ + +#include +#include +#include +#include +#include +#include + +#include "driver.h" +#include "queue.h" +#include "list.h" +#include "stack.h" +#include "kernel.h" +#include "shell.h" +#include "collision_ctrl.h" + +struct sensor_data_object { + bool sys_msg_on; +}; + +struct sensor_data_object sensor_data_object = { + .sys_msg_on = false, +}; + +struct thread_context sensor_data_ctx; +stack_t sensor_data_stack[256]; + +static void sensor_data_loop(void *arg) +{ + char print_buffer[50]; + while(1) { + int collision_distance = collision_ctrl_get_distance_mm(); + if(sensor_data_object.sys_msg_on) { + sprintf(print_buffer, "#SYS:%d\r\n", collision_distance); + shell_write(print_buffer, strlen(print_buffer)); + } + sleep_ms(1000); + } +} + +int sensor_data_init(void) +{ + thread_create( + &sensor_data_ctx, + sensor_data_stack, + sizeof(sensor_data_stack) / sizeof(stack_t), + sensor_data_loop, + NULL, + THREAD_PRIO_LOW); + + return 0; +} + +int sensor_data_sys_msg(bool state) +{ + sensor_data_object.sys_msg_on = state; + + return 0; +} diff --git a/source/application/shell_commands.c b/source/application/shell_commands.c index b8100ba..fb54ef4 100644 --- a/source/application/shell_commands.c +++ b/source/application/shell_commands.c @@ -18,6 +18,7 @@ #include "kernel.h" #include "drive_ctrl.h" #include "version.h" +#include "sensor_data.h" static void *drive_turn_right_cb(const char *param); static void *drive_turn_left_cb(const char *param); @@ -27,6 +28,20 @@ static void *drive_halt_cb(const char *param); static void *drive_forward_cb(const char *param); static void *drive_backward_cb(const char *param); static void *app_version(const char *param); +static void *sys_msg_on_cb(const char *param); +static void *sys_msg_off_cb(const char *param); + +static struct command cmd_sys_msg_on = { + .command = "sys on", + .description = "Switch system message on.", + .command_callback = sys_msg_on_cb, +}; + +static struct command cmd_sys_msg_off = { + .command = "sys off", + .description = "Switch system message off.", + .command_callback = sys_msg_off_cb, +}; static struct command cmd_app_version = { .command = "version", @@ -86,6 +101,8 @@ int shell_commands_init(void) shell_add_command(&drive_halt); shell_add_command(&drive_turn_left); shell_add_command(&drive_turn_right); + shell_add_command(&cmd_sys_msg_off); + shell_add_command(&cmd_sys_msg_on); return 0; } @@ -146,3 +163,14 @@ static void *app_version(const char *param) return NULL; } + +static void *sys_msg_on_cb(const char *param) +{ + sensor_data_sys_msg(true); + return NULL; +} +static void *sys_msg_off_cb(const char *param) +{ + sensor_data_sys_msg(false); + return NULL; +} From 05274f1c3a695c7ea71553e28a51b109b61eda4b Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Tue, 30 Aug 2016 17:27:46 +0200 Subject: [PATCH 5/8] update os lib 0.1.6 -> 0.1.7 --- source/os/release/include/board_devices.h | 1 + source/os/release/include/driver.h | 1 + ...bkosmos-arm-stm32f4-discovery-0.1.7.265.a} | Bin 494394 -> 510782 bytes .../release/libkosmos-arm-stm32f4-discovery.a | 2 +- 4 files changed, 3 insertions(+), 1 deletion(-) rename source/os/release/{libkosmos-arm-stm32f4-discovery-0.1.6.257.a => libkosmos-arm-stm32f4-discovery-0.1.7.265.a} (87%) diff --git a/source/os/release/include/board_devices.h b/source/os/release/include/board_devices.h index 657b7b3..129e41c 100644 --- a/source/os/release/include/board_devices.h +++ b/source/os/release/include/board_devices.h @@ -3,6 +3,7 @@ #ifndef BOARD_DEVICES_H #define BOARD_DEVICES_H +extern const struct driver rng; extern const struct driver gpio_c0; extern const struct driver gpio_c1; extern const struct driver gpio_c2; diff --git a/source/os/release/include/driver.h b/source/os/release/include/driver.h index 6ce5b5d..8af40b4 100644 --- a/source/os/release/include/driver.h +++ b/source/os/release/include/driver.h @@ -17,6 +17,7 @@ enum driver_type { DRIVER_TYPE_GPIO, DRIVER_TYPE_I2C, DRIVER_TYPE_PWM, + DRIVER_TYPE_RNG, DRIVER_TYPE_RTC, DRIVER_TYPE_SPI, DRIVER_TYPE_UART diff --git a/source/os/release/libkosmos-arm-stm32f4-discovery-0.1.6.257.a b/source/os/release/libkosmos-arm-stm32f4-discovery-0.1.7.265.a similarity index 87% rename from source/os/release/libkosmos-arm-stm32f4-discovery-0.1.6.257.a rename to source/os/release/libkosmos-arm-stm32f4-discovery-0.1.7.265.a index f39b35778f1267fc9d541792d39a78e4fb9358bd..08ea1ee80149fcfc1472960544ecabdc9ae2b35a 100644 GIT binary patch delta 21213 zcmc&+33wGnwm#i`Z#sbhA&F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release/libkosmos-arm-stm32f4-discovery.a b/source/os/release/libkosmos-arm-stm32f4-discovery.a index 6ab1828..68482a4 120000 --- a/source/os/release/libkosmos-arm-stm32f4-discovery.a +++ b/source/os/release/libkosmos-arm-stm32f4-discovery.a @@ -1 +1 @@ -libkosmos-arm-stm32f4-discovery-0.1.6.257.a \ No newline at end of file +libkosmos-arm-stm32f4-discovery-0.1.7.265.a \ No newline at end of file From 53215d98159c1f1cc0e4ea368168ef6c051a3dc1 Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Fri, 16 Sep 2016 21:47:37 +0200 Subject: [PATCH 6/8] new os version --- ...bkosmos-arm-stm32f4-discovery-0.1.9.276.a} | Bin 510782 -> 498450 bytes .../release/libkosmos-arm-stm32f4-discovery.a | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename source/os/release/{libkosmos-arm-stm32f4-discovery-0.1.7.265.a => libkosmos-arm-stm32f4-discovery-0.1.9.276.a} (90%) diff --git a/source/os/release/libkosmos-arm-stm32f4-discovery-0.1.7.265.a b/source/os/release/libkosmos-arm-stm32f4-discovery-0.1.9.276.a similarity index 90% rename from source/os/release/libkosmos-arm-stm32f4-discovery-0.1.7.265.a rename to source/os/release/libkosmos-arm-stm32f4-discovery-0.1.9.276.a index 08ea1ee80149fcfc1472960544ecabdc9ae2b35a..05fd6e153875915eaa0b164778ee3a147f6755bc 100644 GIT binary patch delta 7779 zcmchc33L_J8G!#gGjDDPAW4M0mk^Q%L=e>EE%TNLghipqUW$rKH4sw}Vno0w5gp)o z(6T2(xk48NZS^235aAxNhBlsJYf++gsaP@9;!+Vcw$$ZF`rny5FCj!pNa8!^n}6;< z|Nr0r?sMMMY|5$Hm%X8{X#^rhAQt!g1Ag&qe)ao9v1r866eR;_w*xF1>agSpKy#Lz z0BFw2D1ghVuK}8~;V8fZ^Bhd~rY*7#lW2`2F95X0$EbH{7zfY_CY(xxmJq!HPNT>B zK)MFAs{*$%uGwWR`|bn=VDGw^?oC@|ei{&gQ3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DuZTsezxNfj%J<~eHHW;SWBH76s@^Usl_ru0rvyf^Zh zWz<_`-bbr@&A-y>v{6>ooaCA3QE|6cFg3GPsg~_of*ike2PV)!s)!d+$w!>M?0sD~p^k(feJJ$mK06j)-FjIzVYZ!yE_vkKb z@-Xc!eoojd1FelCv@y=c3fe5$qqR@iOK|~zkZq-Fr)WK#trWD7c$~BQf)<`0zd9N{ pCcM@!^R-7D$^yQb@6&cgg6#MEtW^(cud{ Date: Mon, 19 Sep 2016 16:18:04 +0200 Subject: [PATCH 7/8] react to collision detection randomized --- source/application/collision_ctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/application/collision_ctrl.c b/source/application/collision_ctrl.c index 4b878d4..002fc7f 100644 --- a/source/application/collision_ctrl.c +++ b/source/application/collision_ctrl.c @@ -37,6 +37,7 @@ static void collision_ctrl_loop(void *arg) { drv_open(&pwm5_c2); /* trigger pwm */ drv_open(&pwm2_c4); /* read pwm */ + drv_open(&rng); while(1) { int pulse_ns = drv_ioctl(&pwm2_c4, IOCTL_PWM_GET_PULSE_WIDTH_NS, NULL); collision_ctrl_object.distance_mm = 343 * pulse_ns / 1000 / 2; @@ -49,13 +50,13 @@ static void collision_ctrl_loop(void *arg) sprintf(print_buffer, "going back...\r\n"); shell_write(print_buffer, strlen(print_buffer)); drive_ctrl_backward(); - sleep_ms(3000); /* todo: randomize */ + sleep_ms(500); drive_ctrl_halt(); sprintf(print_buffer, "start turning...\r\n"); shell_write(print_buffer, strlen(print_buffer)); drive_ctrl_turn_left(); - sleep_ms(3000); + sleep_ms(drv_read(&rng, Null, 0) % 3500 + 500); // rand between 500 and 4000 drive_ctrl_halt(); sprintf(print_buffer, "restart forward...\r\n"); From 4ead1569c11c203a0459eb154d194333e02cd202 Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Mon, 19 Sep 2016 16:21:18 +0200 Subject: [PATCH 8/8] error correction --- source/application/collision_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/application/collision_ctrl.c b/source/application/collision_ctrl.c index 002fc7f..e3a54a1 100644 --- a/source/application/collision_ctrl.c +++ b/source/application/collision_ctrl.c @@ -56,7 +56,7 @@ static void collision_ctrl_loop(void *arg) sprintf(print_buffer, "start turning...\r\n"); shell_write(print_buffer, strlen(print_buffer)); drive_ctrl_turn_left(); - sleep_ms(drv_read(&rng, Null, 0) % 3500 + 500); // rand between 500 and 4000 + sleep_ms(drv_read(&rng, NULL, 0) % 3500 + 500); // rand between 500 and 4000 drive_ctrl_halt(); sprintf(print_buffer, "restart forward...\r\n");