From 1bcff7dbcbb284f5564ac708292b23fd447395a9 Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Sat, 3 May 2008 11:15:31 +0200 Subject: * digital/io/src * top FSM - change the position where to drop balls at the gutter (to prevent the order of dropped balls to change) ; - change the order of balls taken at the distributor: first two samples with three ice, then three samples with two ice. * get samples FSM - manage the case where the arm passed the noted position in the state where it should not (because the arm was blocked) ; - add some debug messages. * gutter FSM - reduce the time spent to drop the balls at the gutter. * move FSM - update the algorithm to avoid obstacle: when a obstacle is seen, first way, then if it is not present anymore continue, otherwise, try to find an alternative path; if none found, wait again. * chrono - near end of the match time increased to 83s. --- digital/io/src/top_cb.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'digital/io/src/top_cb.c') diff --git a/digital/io/src/top_cb.c b/digital/io/src/top_cb.c index 0cccdf38..2710543d 100644 --- a/digital/io/src/top_cb.c +++ b/digital/io/src/top_cb.c @@ -144,7 +144,7 @@ top__GO_TO_ADVERSE_ICE_DISTRIBUTOR__move_fsm_finished (void) /* Start the get samples FSM with the correct angle to get only two * samples. The problem is this should depend on the time we have until * the end of match */ - uint8_t bitfield = _BV (out_right_box) | _BV (middle_right_box); + uint8_t bitfield = 0x3E; getsamples_start (PG_DISTRIBUTOR_ICE_ADVERSE_A, bitfield); return top_next (GO_TO_ADVERSE_ICE_DISTRIBUTOR, move_fsm_finished); } @@ -161,14 +161,14 @@ top__GO_TO_OUR_ICE_DISTRIBUTOR__move_fsm_finished (void) uint8_t bitfield = 0; if (top_fsm_loop_count_ == 0) { - /* First time we try to get our ice, let's took two */ - bitfield = _BV (middle_left_box) | _BV (middle_right_box); + /* First time we try to get our ice, let's took three */ + bitfield = _BV (out_left_box) | _BV (middle_box) | _BV + (out_right_box); } else { - /* Second time we try to get our ice, let's took only three */ - bitfield = _BV (out_left_box) | _BV (middle_box) | _BV - (out_right_box); + /* Second time we try to get our ice, let's took only two */ + bitfield = _BV (middle_left_box) | _BV (middle_right_box); } getsamples_start (PG_DISTRIBUTOR_ICE_OUR_A, bitfield); return top_next (GO_TO_OUR_ICE_DISTRIBUTOR, move_fsm_finished); @@ -186,15 +186,14 @@ top__GO_TO_SAMPLE_DISTRIBUTOR__move_fsm_finished (void) uint8_t bitfield = 0; if (top_fsm_loop_count_ == 0) { - /* First time we try to get our samples, let's took three of them */ - bitfield = _BV (out_left_box) | _BV (middle_box) | _BV - (out_right_box); + /* First time we try to get our samples, let's took only two of them */ + bitfield = _BV (middle_left_box) | _BV (middle_right_box); } else { - /* Second time we try to get our samples, let's took only two of them - */ - bitfield = _BV (middle_left_box) | _BV (middle_right_box); + /* Second time we try to get our samples, let's took three of them */ + bitfield = _BV (out_left_box) | _BV (middle_box) | _BV + (out_right_box); } getsamples_start (PG_DISTRIBUTOR_SAMPLE_OUR_A, bitfield); return top_next (GO_TO_SAMPLE_DISTRIBUTOR, move_fsm_finished); -- cgit v1.2.3