summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Schodet2012-05-16 20:55:22 +0200
committerNicolas Schodet2012-05-16 21:01:45 +0200
commit1d00b79b1e179cf947d915ca2033ce690ed5b7a5 (patch)
tree44d436353d826ef08082425f6e4e82fec4950797
parentb2dbe0ad84501849aa016f9d9cf5b9444f83822e (diff)
digital/io-hub/src/guybrush: handle more blocking
-rw-r--r--digital/io-hub/src/guybrush/top.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/digital/io-hub/src/guybrush/top.c b/digital/io-hub/src/guybrush/top.c
index 187edcab..540d0385 100644
--- a/digital/io-hub/src/guybrush/top.c
+++ b/digital/io-hub/src/guybrush/top.c
@@ -258,6 +258,14 @@ FSM_TRANS (TOP_TOTEM_CLEAN_APPROACHING, robot_move_success,
return FSM_NEXT (TOP_TOTEM_CLEAN_APPROACHING, robot_move_success);
}
+FSM_TRANS (TOP_TOTEM_CLEAN_APPROACHING, robot_move_failure,
+ TOP_TOTEM_CLEAN_CATCH_WAITING)
+{
+ /* Must be blocked on a CD, catch and continue. */
+ FSM_HANDLE (AI, clean_catch);
+ return FSM_NEXT (TOP_TOTEM_CLEAN_APPROACHING, robot_move_failure);
+}
+
FSM_TRANS (TOP_TOTEM_CLEAN_CATCH_WAITING, clamps_ready,
TOP_TOTEM_CLEAN_GOING_BACK)
{
@@ -274,6 +282,13 @@ FSM_TRANS (TOP_TOTEM_CLEAN_GOING_BACK, robot_move_success,
return FSM_NEXT (TOP_TOTEM_CLEAN_GOING_BACK, robot_move_success);
}
+FSM_TRANS (TOP_TOTEM_CLEAN_GOING_BACK, robot_move_failure,
+ TOP_TOTEM_CLEAN_LOADING)
+{
+ FSM_HANDLE (AI, clean_load);
+ return FSM_NEXT (TOP_TOTEM_CLEAN_GOING_BACK, robot_move_failure);
+}
+
FSM_TRANS (TOP_TOTEM_CLEAN_LOADING, clamps_ready, TOP_TOTEM_CLAMP_DOWNING)
{
clamp_request (FSM_EVENT (AI, tree_detected));