turn commands improved

This commit is contained in:
Thomas Klaehn 2016-08-11 21:42:06 +02:00
parent 02a8334ebb
commit 4204b82bd6

View File

@ -78,8 +78,10 @@ int shell_commands_init(void)
static void *drive_turn_right_cb(const char *param) static void *drive_turn_right_cb(const char *param)
{ {
int speed = drive_ctrl_get_speed_value(); int speed = drive_ctrl_get_speed_value();
drive_ctrl_set_speed_left(speed); drive_ctrl_set_speed_left(abs(speed));
drive_ctrl_set_speed_right(0); if(speed > 0)
speed *= -1;
drive_ctrl_set_speed_right(speed);
return NULL; return NULL;
} }
@ -87,8 +89,10 @@ static void *drive_turn_right_cb(const char *param)
static void *drive_turn_left_cb(const char *param) static void *drive_turn_left_cb(const char *param)
{ {
int speed = drive_ctrl_get_speed_value(); int speed = drive_ctrl_get_speed_value();
drive_ctrl_set_speed_left(0); drive_ctrl_set_speed_right(abs(speed));
drive_ctrl_set_speed_right(speed); if(speed > 0)
speed *= -1;
drive_ctrl_set_speed_left(speed);
return NULL; return NULL;
} }