#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 | RED_BASKET |
| #define | BASKET_GOALX 0.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 |
Enumerations | |
| enum | { UNKNOWN = 0, BOTTLE = 0, CAN } |
| enum | { LEFT = 0, CENTER, RIGHT } |
Evaluation function to see in what direction the waste is. More... | |
Functions | |
| UL_LOG_CUST (ulogd_competetion) | |
| 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 | main () |
Variables | |
| struct position_type | des_pos |
| #define BASKET_GOALX 0.0 |
| #define BASKET_GOALY 0.0 |
| #define COMPETITION_TIME 600 |
| #define DEPOSITE_WAIT 1000 |
Time constants.
| #define FSM_MAIN |
| #define LAST_DEPOSITE_WAIT 1500 |
| #define NEW_PICK_UP_WAIT 1000 |
| #define RED_BASKET |
| #define STACK_SIZE 3 |
| #define WASTE_DETECTION_PERIOD 100 |
| #define WASTE_ROLL_OUT_WAIT 900 |
| anonymous enum |
| int basket_behind | ( | ) |
Evaluation function to be sure the basket is behind us.
| FSM_STATE | ( | main_init | ) |
Set starting position, playground`s safety zone and other obstacles.
FSM: main init.

| 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_DECL | ( | go_to_basket | ) |
| FSM_STATE_DECL | ( | search_waste | ) |
| FSM_STATE_DECL | ( | turn_robot | ) |
| FSM_STATE_DECL | ( | follow_waste | ) |
| FSM_STATE_DECL | ( | waste_grab | ) |
| FSM_STATE_DECL | ( | waste_deposite_wait | ) |
| FSM_STATE_DECL | ( | main_init | ) |
FSM states start here.
| 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 main | ( | void | ) |

| 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_competetion | ) |
| 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 |
1.7.1