![]() |
master board program
v. 2 - 2018
|
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "camera.h"
#include "config.h"
#include "compass.h"
#include "lines.h"
#include "motor.h"
#include "kicker.h"
#include "leds.h"
#include "dip_switch.h"
#include "jetson.h"
#include "chprintf.h"
#include "ultrasonic.h"
#include <math.h>
Macros | |
#define | MAX_SPEED 923 |
#define | MAX_ROBOT_POWER 15 |
#define | MIN_ROBOT_POWER 40 |
#define | FAR_POINT 0 |
#define | NEER_POINT 400 |
#define | ALIGN_POWER 50 |
#define | DRIBLER_SPEED -1900 |
#define | PI 3.14159 |
#define | ALIGN_TOLLERANCE 5 |
#define | SHOOTING_RANGE 5 |
#define | HAVING_BALL_RANGE 5 |
#define | OBJECT_NOT_FOUND 420 |
#define | SEARCH_SPEED 20 |
#define | DRIBLER_REACTION_TIME 600 |
#define | CAMERA_CENTER 4 |
#define | AROUND_BALL_ALIGN 0 |
#define | BASIC_ALIGN 1 |
#define | CLASSIC_ALIGN 2 |
#define | NOT_ALIGN 3 |
#define | LINE_CALIBRATION_ALIGN 4 |
Functions | |
int16_t | sinn (int16_t degree) |
int16_t | abs_value_int (int16_t a) |
void | motors_off (void) |
int16_t | set_motor_speed (int16_t relative_speed) |
void | set_dribler_speed (int32_t dribler_speed) |
void | set_movement (int16_t degree) |
void | correct_motors_speeds (int8_t align_type, int16_t speed, int16_t align_speed) |
int | main (void) |
Variables | |
int16_t | movement_degree = 90 |
int16_t | old_line = 0 |
int16_t | dribler_timer = 0 |
int8_t | have_ball = 0 |
int8_t | using_align = CLASSIC_ALIGN |
int16_t | loop = 0 |
int32_t | move_time = 600 |
int32_t | stop_time = 24000 |
int16_t | sinus [91] = {0, 17, 34, 52, 69, 87, 104, 121, 139, 156, 173, 190, 207, 224, 241, 258, 275, 292, 309, 325, 342, 358, 374, 390, 406, 422, 438, 453, 469, 484, 499, 515, 529, 544, 559, 573, 587, 601, 615, 629, 642, 656, 669, 681, 694, 707, 719, 731, 743, 754, 766, 777, 788, 798, 809, 819, 829, 838, 848, 857, 866, 874, 882, 891, 898, 906, 913, 920, 927, 933, 939, 945, 951, 956, 961, 965, 970, 974, 978, 981, 984, 987, 990, 992, 994, 996, 997, 998, 999, 999, 1000} |
#define ALIGN_POWER 50 |
#define ALIGN_TOLLERANCE 5 |
#define AROUND_BALL_ALIGN 0 |
#define BASIC_ALIGN 1 |
#define CAMERA_CENTER 4 |
#define CLASSIC_ALIGN 2 |
#define DRIBLER_REACTION_TIME 600 |
#define DRIBLER_SPEED -1900 |
#define FAR_POINT 0 |
#define HAVING_BALL_RANGE 5 |
#define LINE_CALIBRATION_ALIGN 4 |
#define MAX_ROBOT_POWER 15 |
#define MAX_SPEED 923 |
#define MIN_ROBOT_POWER 40 |
#define NEER_POINT 400 |
#define NOT_ALIGN 3 |
#define OBJECT_NOT_FOUND 420 |
#define PI 3.14159 |
#define SEARCH_SPEED 20 |
#define SHOOTING_RANGE 5 |
int16_t abs_value_int | ( | int16_t | a | ) |
void correct_motors_speeds | ( | int8_t | align_type, |
int16_t | speed, | ||
int16_t | align_speed | ||
) |
int main | ( | void | ) |
void motors_off | ( | void | ) |
void set_dribler_speed | ( | int32_t | dribler_speed | ) |
int16_t set_motor_speed | ( | int16_t | relative_speed | ) |
void set_movement | ( | int16_t | degree | ) |
int16_t sinn | ( | int16_t | degree | ) |
int16_t dribler_timer = 0 |
int8_t have_ball = 0 |
int16_t loop = 0 |
int32_t move_time = 600 |
int16_t movement_degree = 90 |
int16_t old_line = 0 |
int16_t sinus[91] = {0, 17, 34, 52, 69, 87, 104, 121, 139, 156, 173, 190, 207, 224, 241, 258, 275, 292, 309, 325, 342, 358, 374, 390, 406, 422, 438, 453, 469, 484, 499, 515, 529, 544, 559, 573, 587, 601, 615, 629, 642, 656, 669, 681, 694, 707, 719, 731, 743, 754, 766, 777, 788, 798, 809, 819, 829, 838, 848, 857, 866, 874, 882, 891, 898, 906, 913, 920, 927, 933, 939, 945, 951, 956, 961, 965, 970, 974, 978, 981, 984, 987, 990, 992, 994, 996, 997, 998, 999, 999, 1000} |
int32_t stop_time = 24000 |
int8_t using_align = CLASSIC_ALIGN |