From ddf13c7289697864c1b29dc51c44b175ef0c3023 Mon Sep 17 00:00:00 2001 From: schodet Date: Mon, 6 Aug 2007 12:41:58 +0000 Subject: Fixed bad M_2_PI usage (M_2_PI = 2/pi, not 2*pi). --- n/asserv/src/asserv/simu.host.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'n/asserv/src/asserv/simu.host.c') diff --git a/n/asserv/src/asserv/simu.host.c b/n/asserv/src/asserv/simu.host.c index bb204c1..adf5b34 100644 --- a/n/asserv/src/asserv/simu.host.c +++ b/n/asserv/src/asserv/simu.host.c @@ -218,11 +218,11 @@ simu_step (void) motor_model_step (&simu_left_model); motor_model_step (&simu_right_model); /* Modify counters. */ - counter_left_diff = (simu_left_model.th - old_left_th) / M_2_PI * 500 * - simu_left_model.i_G; + counter_left_diff = (simu_left_model.th - old_left_th) / (2*M_PI) + * 500 * simu_left_model.i_G; counter_left += counter_left_diff; - counter_right_diff = (simu_right_model.th - old_right_th) / M_2_PI * 500 * - simu_right_model.i_G; + counter_right_diff = (simu_right_model.th - old_right_th) / (2*M_PI) + * 500 * simu_right_model.i_G; counter_right += counter_right_diff; /* Update position */ simu_pos_update ((simu_left_model.th - old_left_th) -- cgit v1.2.3