Defines | Enumerations | Functions | Variables

competition.cc File Reference

#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>
Include dependency graph for competition.cc:

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 Documentation

#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

Enumeration Type Documentation

anonymous enum
Enumerator:
UNKNOWN 
BOTTLE 
CAN 
anonymous enum

Evaluation function to see in what direction the waste is.

Returns:
Returns enum value LEFT = 0, CENTER = 1, RIGHT = 2
Enumerator:
LEFT 
CENTER 
RIGHT 

Function Documentation

int basket_behind (  ) 

Evaluation function to be sure the basket is behind us.

Returns:
FSM_STATE ( main_init   ) 

Set starting position, playground`s safety zone and other obstacles.

FSM: main init.

Here is the call graph for this function:

FSM_STATE ( plan_go   ) 

Go and try to detect some waste.

Here is the call graph for this function:

FSM_STATE ( search_waste   ) 

Here is the call graph for this function:

FSM_STATE ( waste_grab   ) 

Here is the call graph for this function:

FSM_STATE ( go_to_basket   ) 

Go to basket to deposite the waste.

Here is the call graph for this function:

FSM_STATE ( waste_deposite   ) 

Deposite waste.

Here is the call graph for this function:

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 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void get_short_sharp_mm ( int *  sharp  ) 

Convert sharp`s measured values to mm.

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( void   ) 

Here is the call graph for this function:

int recognize_waste (  ) 

Try to detect type of the waste.

Returns:
returns type of the waste.

Here is the caller graph for this function:

void robot_turn ( struct position_type  des_pos  ) 

Here is the call graph for this function:

Here is the caller graph for this function:

int stack_empty (  ) 

Check out if stack is empty.

Use back innerIR sensors to do it.

Returns:
returns true if IR sensors indicate the waste

Here is the caller graph for this function:

UL_LOG_CUST ( ulogd_competetion   ) 
void * wait_for_end ( void *  arg  ) 

Competition timer.

Stop robot when the timer exceeds.

Here is the call graph for this function:

Here is the caller graph for this function:

int waste_ahead (  ) 

Check out sharp values to evaluate, if waste is in our reach.

Returns:
returns true if waste is in our reach.

Here is the call graph for this function:

Here is the caller graph for this function:

int waste_direction (  ) 

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

struct position_type des_pos