From: Xavier L. <Ba...@us...> - 2011-04-21 11:46:55
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "krobot". The branch, master has been updated via 9c40637e10a40854186ed9a50c002088be65a64d (commit) from 3bf7caba254cd6a7beabb131102adc5a5d71fa43 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9c40637e10a40854186ed9a50c002088be65a64d Author: Xavier Lagorce <Xav...@cr...> Date: Thu Apr 21 13:46:21 2011 +0200 [Controller_Motor_STM32] Cleanup ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.c b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.c index 2a4b2c5..a132452 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.c +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.c @@ -66,7 +66,6 @@ static void NORETURN traj_following_process(void) { proc_exit(); } else { if (!params.working && params.trajs[next_traj].initialized) { - LED2_ON(); params.working = 1; params.u = 0; ui = 0; @@ -85,8 +84,6 @@ static void NORETURN traj_following_process(void) { // Stop following the trajectory if we are close enough to our goal if (params.u >= 1.0 || ((rs.x-traj->goal[0]) * (rs.x-traj->goal[0]) + (rs.y-traj->goal[1]) * (rs.y-traj->goal[1])) <= (0.01*0.01)) { - //if (((rs.x-traj->goal[0]) * (rs.x-traj->goal[0]) + (rs.y-traj->goal[1]) * (rs.y-traj->goal[1])) <= (0.01*0.01)) { - LED2_OFF(); params.working = 0; traj->initialized = 0; traj->enabled = 0; @@ -126,18 +123,14 @@ static void NORETURN traj_following_process(void) { dxu = bezier_apply(traj->dparams[0], params.u); dyu = bezier_apply(traj->dparams[1], params.u); params.u += v_lin/sqrtf(dxu*dxu+dyu*dyu)*dt; - //if (u >= 1.0) { - // u = 1.0; - //} else { - params.ghost_state.x += v_lin*cosf(params.ghost_state.theta)*dt; - params.ghost_state.y += v_lin*sinf(params.ghost_state.theta)*dt; - params.ghost_state.theta = fmodf(params.ghost_state.theta + v_rot*dt, 2*M_PI); - if (params.ghost_state.theta > M_PI) { - params.ghost_state.theta -= 2*M_PI; - } else if (params.ghost_state.theta <= M_PI) { - params.ghost_state.theta += 2*M_PI; - } - //} + params.ghost_state.x += v_lin*cosf(params.ghost_state.theta)*dt; + params.ghost_state.y += v_lin*sinf(params.ghost_state.theta)*dt; + params.ghost_state.theta = fmodf(params.ghost_state.theta + v_rot*dt, 2*M_PI); + if (params.ghost_state.theta > M_PI) { + params.ghost_state.theta -= 2*M_PI; + } else if (params.ghost_state.theta <= M_PI) { + params.ghost_state.theta += 2*M_PI; + } // Compute command z1=(rs.x-params.ghost_state.x)*cosf(params.ghost_state.theta)+(rs.y-params.ghost_state.y)*sinf(params.ghost_state.theta); hooks/post-receive -- krobot |