From a48c26a13614dab1af11d3a6b46a6dc0921e2756 Mon Sep 17 00:00:00 2001 From: NĂ©lio Laranjeiro Date: Sun, 27 Apr 2008 11:35:03 +0200 Subject: move.fsm: Update the fsm to use the path finder. * update the events in the main.c file. * update the move_cb.c * added some constants. --- digital/io/src/move.h | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) (limited to 'digital/io/src/move.h') diff --git a/digital/io/src/move.h b/digital/io/src/move.h index 69a2975e..b5d2a483 100644 --- a/digital/io/src/move.h +++ b/digital/io/src/move.h @@ -27,17 +27,24 @@ #include "asserv.h" -/* if the left border is under 500 mm of the actual position do not go there. */ -#define MOVE_BORDER_LEVEL 200 - +#define MOVE_OBSTACLE_RADIUS 100 +#define MOVE_OBSTACLE_VALIDITY 650 /** move FSM associated data. */ struct move_data_t { /* Desired x position to reached. */ - uint32_t position_x; + uint16_t position_x; /* Desired y position to reached. */ - uint32_t position_y; + uint16_t position_y; + /* number of obstacles seen. */ + uint8_t nb_obstacle; + /* Path finder position x. */ + uint16_t path_pos_x; + /* Path finder position y. */ + uint16_t path_pos_y; + /* Position blocked. */ + asserv_position_t pos_blocked_or_failed; }; @@ -48,24 +55,4 @@ extern struct move_data_t move_data; void move_start (uint32_t position_x, uint32_t position_y); -/** Verify if the position desired is in the table use when the robot tries to - * reach a point and a obstacle is in front of it. - * \param pos the robot's current position on the table. - * \param new_pos the position computed to go to. - * \return true if the it can reach the position. - */ -uint8_t -move_can_go_on_left_or_right (asserv_position_t current_pos, - asserv_position_t new_pos); - -/** Go to the right. - */ -void -move_go_to_right (void); - -/** Go to the left. - */ -void -move_go_to_left (void); - #endif /* move_h */ -- cgit v1.2.3