#include "robot.h"
#include <fsm.h>
#include <unistd.h>
#include <servos_eb2007.h>
#include <math.h>
#include "trgen.h"
#include <movehelper_eb2007.h>
#include <map.h>
#include <sharp.h>
#include <robomath.h>
#include <ul_log.h>
Defines | |
#define | FSM_MAIN |
#define | FSM_MAIN_PETERBURG |
#define | HOMOLOGACE |
#define | RED_BASKET |
#define | BASKET_GOALX 3.0 |
#define | BASKET_GOALY 0.0 |
#define | COMPETITION_TIME 600 |
#define | STACK_SIZE 3 |
#define | DEPOSITE_WAIT 1000 |
Time constants. | |
#define | LAST_DEPOSITE_WAIT 1500 |
#define | WASTE_ROLL_OUT_WAIT 900 |
#define | NEW_PICK_UP_WAIT 1000 |
#define | WASTE_DETECTION_PERIOD 100 |
#define | WAIT_TRANSPORTER_FORWARD_MS 1000 |
#define | WAIT_TRANSPORTER_BACKWARD_MS 1000 |
#define | WAIT_TRANSPORTER_STOP_MS 1000 |
#define | WAIT_WASTE_PULLED_IN_MS 100 |
#define | WAIT_DOOR_OPEN_MS 1000 |
#define | WAIT_PREPARE_FLUSHING_MS 1000 |
#define | WAIT_FLUSHING_BOTTLE_MS 1000 |
#define | WAIT_FLUSHING_CAN_MS 1000 |
#define | DEMO |
Enumerations | |
enum | { UNKNOWN = 0, BOTTLE = 0, CAN } |
enum | { LEFT = 0, CENTER, RIGHT } |
Evaluation function to see in what direction the waste is. More... | |
enum | { BOTTLE = 0, CAN, FT_STOP, FT_FORWARD, FT_BACKWARD, FD_UP, WASTE_NOT_PULLED_IN, WASTE_WAIT_PULLING_IN, WASTE_PULLED_IN } |
Functions | |
UL_LOG_CUST (ulogd_fsmmain) | |
void | get_short_sharp_mm (int *sharp) |
Convert sharp`s measured values to mm. | |
int | waste_ahead () |
Check out sharp values to evaluate, if waste is in our reach. | |
int | stack_empty () |
Check out if stack is empty. | |
int | basket_behind () |
Evaluation function to be sure the basket is behind us. | |
int | recognize_waste () |
Try to detect type of the waste. | |
int | waste_direction () |
void * | wait_for_end (void *arg) |
Competition timer. | |
void | get_new_pos (struct position_type *act, struct position_type *req, double l, double phi) |
void | robot_turn (struct position_type des_pos) |
FSM_STATE_DECL (main_init) | |
FSM states start here. | |
FSM_STATE_DECL (plan_go) | |
FSM_STATE_DECL (waste_grab) | |
FSM_STATE_DECL (waste_deposite) | |
FSM_STATE_DECL (waste_deposite_wait) | |
FSM_STATE_DECL (go_to_basket) | |
FSM_STATE_DECL (search_waste) | |
FSM_STATE_DECL (turn_robot) | |
FSM_STATE_DECL (follow_waste) | |
FSM_STATE (main_init) | |
Set starting position, playground`s safety zone and other obstacles. | |
FSM_STATE (plan_go) | |
Go and try to detect some waste. | |
FSM_STATE (search_waste) | |
FSM_STATE (waste_grab) | |
FSM_STATE (go_to_basket) | |
Go to basket to deposite the waste. | |
FSM_STATE (waste_deposite) | |
Deposite waste. | |
FSM_STATE (waste_deposite_wait) | |
int | fsm_main_init (struct robo_fsm *fsm, int ret_code) |
void | avoid_enemy () |
void | follow_bottle () |
FSM_STATE (enemy_avoidance) | |
FSM_STATE_DECL (main_wait) | |
FSM_STATE_DECL (main_follow_bott) | |
FSM_STATE (main_wait) | |
FSM_STATE_DECL (main_grab) | |
FSM_STATE (main_follow_bott) | |
FSM_STATE (main_grab) | |
Variables | |
struct position_type | des_pos |
#define BASKET_GOALX 3.0 |
#define BASKET_GOALY 0.0 |
#define COMPETITION_TIME 600 |
#define DEMO |
#define DEPOSITE_WAIT 1000 |
Time constants.
#define FSM_MAIN |
#define FSM_MAIN_PETERBURG |
#define HOMOLOGACE |
#define LAST_DEPOSITE_WAIT 1500 |
#define NEW_PICK_UP_WAIT 1000 |
#define RED_BASKET |
#define STACK_SIZE 3 |
#define WAIT_DOOR_OPEN_MS 1000 |
#define WAIT_FLUSHING_BOTTLE_MS 1000 |
#define WAIT_FLUSHING_CAN_MS 1000 |
#define WAIT_PREPARE_FLUSHING_MS 1000 |
#define WAIT_TRANSPORTER_BACKWARD_MS 1000 |
#define WAIT_TRANSPORTER_FORWARD_MS 1000 |
#define WAIT_TRANSPORTER_STOP_MS 1000 |
#define WAIT_WASTE_PULLED_IN_MS 100 |
#define WASTE_DETECTION_PERIOD 100 |
#define WASTE_ROLL_OUT_WAIT 900 |
anonymous enum |
anonymous enum |
void avoid_enemy | ( | ) |
int basket_behind | ( | ) |
Evaluation function to be sure the basket is behind us.
void follow_bottle | ( | ) |
int fsm_main_init | ( | struct robo_fsm * | fsm, | |
int | ret_code | |||
) |
FSM_STATE | ( | main_init | ) |
Set starting position, playground`s safety zone and other obstacles.
FSM: main init.
FSM_STATE | ( | main_wait | ) |
FSM_STATE | ( | main_follow_bott | ) |
FSM_STATE | ( | main_grab | ) |
FSM_STATE | ( | plan_go | ) |
Go and try to detect some waste.
FSM_STATE | ( | search_waste | ) |
FSM_STATE | ( | waste_grab | ) |
FSM_STATE | ( | go_to_basket | ) |
Go to basket to deposite the waste.
FSM_STATE | ( | waste_deposite | ) |
Deposite waste.
FSM_STATE | ( | waste_deposite_wait | ) |
FSM_STATE | ( | enemy_avoidance | ) |
FSM_STATE_DECL | ( | main_wait | ) |
FSM_STATE_DECL | ( | main_follow_bott | ) |
FSM_STATE_DECL | ( | search_waste | ) |
FSM_STATE_DECL | ( | go_to_basket | ) |
FSM_STATE_DECL | ( | turn_robot | ) |
FSM_STATE_DECL | ( | follow_waste | ) |
FSM_STATE_DECL | ( | main_init | ) |
FSM states start here.
FSM_STATE_DECL | ( | main_grab | ) |
FSM_STATE_DECL | ( | waste_deposite_wait | ) |
FSM_STATE_DECL | ( | waste_grab | ) |
FSM_STATE_DECL | ( | plan_go | ) |
FSM_STATE_DECL | ( | waste_deposite | ) |
void get_new_pos | ( | struct position_type * | act, | |
struct position_type * | req, | |||
double | l, | |||
double | phi | |||
) |
void get_short_sharp_mm | ( | int * | sharp | ) |
Convert sharp`s measured values to mm.
int recognize_waste | ( | ) |
Try to detect type of the waste.
void robot_turn | ( | struct position_type | des_pos | ) |
int stack_empty | ( | ) |
Check out if stack is empty.
Use back innerIR sensors to do it.
UL_LOG_CUST | ( | ulogd_fsmmain | ) |
void* wait_for_end | ( | void * | arg | ) |
Competition timer.
Stop robot when the timer exceeds.
int waste_ahead | ( | ) |
Check out sharp values to evaluate, if waste is in our reach.
int waste_direction | ( | ) |
struct position_type des_pos |