summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/top_cb.c
diff options
context:
space:
mode:
authorJérémy Dufour2008-04-23 10:56:01 +0200
committerJérémy Dufour2008-04-23 10:56:01 +0200
commit775eaa0998d0257b6fcd55048c98fa847183892b (patch)
treeb069b185035701885f53736fa35cb931fc277b17 /digital/io/src/top_cb.c
parent03cd2aa5d831f69e5c19ee0a2850eeacf3fbc8bf (diff)
* digital/io/src
- add a state to the top FSM to move away from the border.
Diffstat (limited to 'digital/io/src/top_cb.c')
-rw-r--r--digital/io/src/top_cb.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/digital/io/src/top_cb.c b/digital/io/src/top_cb.c
index 352fbc86..a1bdee4a 100644
--- a/digital/io/src/top_cb.c
+++ b/digital/io/src/top_cb.c
@@ -97,6 +97,19 @@ top__GET_SAMPLES_FROM_SAMPLES_DISTRIBUTOR__get_samples_fsm_finished (void)
}
/*
+ * MOVE_AWAY_FROM_BORDER =move_fsm_finished=>
+ * => GO_TO_SAMPLE_DISTRIBUTOR
+ * order the bot to move to our samples distributors with the move FSM
+ */
+fsm_branch_t
+top__MOVE_AWAY_FROM_BORDER__move_fsm_finished (void)
+{
+ /* Start the move FSM to our samples distributor */
+ move_start (PG_DISTRIBUTOR_SAMPLE_OUR_X, PG_DISTRIBUTOR_SAMPLE_OUR_Y);
+ return top_next (MOVE_AWAY_FROM_BORDER, move_fsm_finished);
+}
+
+/*
* GO_TO_ADVERSE_ICE_DISTRIBUTOR =move_fsm_finished=>
* => GET_ICE_FROM_ADVERSE_ICE_DISTRIBUTOR
* we are now in front of the adverse ice distributor, launch the get samples
@@ -222,16 +235,16 @@ top__WAIT_JACK_IN__jack_inserted_into_bot (void)
/*
* CONFIGURE_ASSERV =settings_acknowledged=>
- * => GO_TO_SAMPLE_DISTRIBUTOR
- * order the bot to move to our samples distributors with the move FSM
+ * => MOVE_AWAY_FROM_BORDER
+ * move the bot away from the border to be able to turn freely
*/
fsm_branch_t
top__CONFIGURE_ASSERV__settings_acknowledged (void)
{
/* Clear the flag for the setting acknowleged */
top_waiting_for_settings_ack_ = 0;
- /* Start the move FSM to our samples distributor */
- move_start (PG_DISTRIBUTOR_SAMPLE_OUR_X, PG_DISTRIBUTOR_SAMPLE_OUR_Y);
+ /* Start the move FSM to move the the bot away from the border */
+ move_start (PG_X_START, PG_Y_START + BOT_MIN_DISTANCE_TURN_FREE);
return top_next (CONFIGURE_ASSERV, settings_acknowledged);
}