#include <robodata.h>
#include <robot.h>
#include <fsm.h>
#include <unistd.h>
#include <servos.h>
#include <math.h>
#include "trgen.h"
#include <movehelper.h>
#include <map.h>
#include <sharp.h>
#include <robomath.h>
#include <string.h>
#include <error.h>
#include <ul_log.h>
Defines | |
#define | FSM_MAIN |
#define | COMPETITION_TIME_DEFAULT 900 |
#define | TIME_TO_DEPOSITE_DEFAULT 60 |
#define | COMPETITION_TIME COMPETITION_TIME_DEFAULT |
#define | TIME_TO_DEPOSITE TIME_TO_DEPOSITE_DEFAULT |
#define | GO_TO_CONTAINER_TIMER 10000 |
#define | MAX_GET_BALL_ATTEMPS 8 |
#define | GET_BALL_TIMER 1500 |
#define | WAIT_BALL_INSIDE 5000 |
#define | GET_BALL_BAGR_SPEED 130 |
#define | MAX_CAROUSEL_ATTEMPTS 3 |
#define | CAROUSEL_ATTEMPT_TIMER 1000 |
#define | WAIT_FOR_DEPOSITION_TIMER 1500 |
Enumerations | |
enum | { LEFT = 0, RIGHT, CENTER } |
Functions | |
UL_LOG_CUST (ulogd_homologation) | |
void | get_back_sharp_mm (int *sharp) |
Convert back sharps' measured values to mm. | |
void | get_rear_sharp_mm (int *sharp) |
Convert rear sharps' measured values to mm. | |
void | get_front_sharp_mm (int *sharp) |
Convert front sharps' measured values to mm. | |
void | get_front_sharp_m (double *sharp) |
Get values from front sharps. | |
void | get_rear_sharp_m (double *sharp) |
Get values from rear sharps. | |
void | get_back_sharp_m (double *sharp) |
Get values from back sharps. | |
int | closed_to_dispenser () |
Use bumpers check if we are closed to the dispenser. | |
int | closed_to_container () |
void * | wait_for_end (void *arg) |
Competition timer. | |
void * | wait_to_deposition (void *arg) |
Timer to go to tray. | |
void | get_relative_pos (struct est_pos_type *est, struct ref_pos_type *ref, double l, double phi) |
Get position of the point when we know the distance and angle to turn. | |
void | robot_goto_point (struct ref_pos_type des_pos) |
void | robot_go_closer () |
void | trans_callback (struct robo_fsm *fsm) |
void | move_trans_callback (struct robo_fsm *fsm) |
FSM_STATE_DECL (init) | |
FSM_STATE_DECL (wait_for_start) | |
FSM_STATE_DECL (go_to_our_white_dispenser) | |
FSM_STATE_DECL (go_to_our_white_dispenser2) | |
FSM_STATE_DECL (go_to_container) | |
FSM_STATE_DECL (go_back) | |
FSM_STATE_DECL (get_balls) | |
FSM_STATE_DECL (next_carousel_position) | |
FSM_STATE_DECL (deposite_balls) | |
FSM_STATE (init) | |
FSM_STATE (wait_for_start) | |
FSM_STATE (go_to_our_white_dispenser) | |
FSM_STATE (go_to_our_white_dispenser2) | |
FSM_STATE (go_to_our_red_dispenser) | |
FSM_STATE (go_to_our_red_dispenser2) | |
FSM_STATE (go_back) | |
FSM_STATE (go_to_container) | |
FSM_STATE (get_balls) | |
FSM_STATE (next_carousel_position) | |
FSM_STATE (deposite_balls) | |
int | main () |
#define CAROUSEL_ATTEMPT_TIMER 1000 |
#define COMPETITION_TIME COMPETITION_TIME_DEFAULT |
#define COMPETITION_TIME_DEFAULT 900 |
#define FSM_MAIN |
#define GET_BALL_BAGR_SPEED 130 |
#define GET_BALL_TIMER 1500 |
#define GO_TO_CONTAINER_TIMER 10000 |
#define MAX_CAROUSEL_ATTEMPTS 3 |
#define MAX_GET_BALL_ATTEMPS 8 |
#define TIME_TO_DEPOSITE TIME_TO_DEPOSITE_DEFAULT |
#define TIME_TO_DEPOSITE_DEFAULT 60 |
#define WAIT_BALL_INSIDE 5000 |
#define WAIT_FOR_DEPOSITION_TIMER 1500 |
int closed_to_container | ( | ) |
int closed_to_dispenser | ( | ) |
Use bumpers check if we are closed to the dispenser.
FSM_STATE | ( | go_back | ) |
FSM_STATE | ( | go_to_container | ) |
FSM_STATE | ( | get_balls | ) |
FSM_STATE | ( | next_carousel_position | ) |
FSM_STATE | ( | deposite_balls | ) |
FSM_STATE | ( | go_to_our_red_dispenser2 | ) |
FSM_STATE | ( | init | ) |
FSM_STATE | ( | wait_for_start | ) |
FSM_STATE | ( | go_to_our_white_dispenser | ) |
FSM_STATE | ( | go_to_our_white_dispenser2 | ) |
FSM_STATE | ( | go_to_our_red_dispenser | ) |
FSM_STATE_DECL | ( | init | ) |
FSM_STATE_DECL | ( | wait_for_start | ) |
FSM_STATE_DECL | ( | get_balls | ) |
FSM_STATE_DECL | ( | go_to_our_white_dispenser | ) |
FSM_STATE_DECL | ( | go_to_our_white_dispenser2 | ) |
FSM_STATE_DECL | ( | go_to_container | ) |
FSM_STATE_DECL | ( | go_back | ) |
FSM_STATE_DECL | ( | next_carousel_position | ) |
FSM_STATE_DECL | ( | deposite_balls | ) |
void get_back_sharp_m | ( | double * | sharp | ) |
Get values from back sharps.
void get_back_sharp_mm | ( | int * | sharp | ) |
Convert back sharps' measured values to mm.
void get_front_sharp_m | ( | double * | sharp | ) |
Get values from front sharps.
void get_front_sharp_mm | ( | int * | sharp | ) |
Convert front sharps' measured values to mm.
void get_rear_sharp_m | ( | double * | sharp | ) |
Get values from rear sharps.
void get_rear_sharp_mm | ( | int * | sharp | ) |
Convert rear sharps' measured values to mm.
void get_relative_pos | ( | struct est_pos_type * | est, | |
struct ref_pos_type * | ref, | |||
double | l, | |||
double | phi | |||
) |
Get position of the point when we know the distance and angle to turn.
act | actual position | |
pos | countered position |
int main | ( | void | ) |
void move_trans_callback | ( | struct robo_fsm * | fsm | ) |
void robot_go_closer | ( | ) |
void robot_goto_point | ( | struct ref_pos_type | des_pos | ) |
void trans_callback | ( | struct robo_fsm * | fsm | ) |
UL_LOG_CUST | ( | ulogd_homologation | ) |
void* wait_for_end | ( | void * | arg | ) |
Competition timer.
Stop robot when the timer exceeds.
void* wait_to_deposition | ( | void * | arg | ) |
Timer to go to tray.