KRAI ITB GARUDAGO / Mbed 2 deprecated krai_roda2019

Dependencies:   mbed pid_dagoz

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers variable.h Source File

variable.h

00001 /*Garudago ITB 2019 Attributes*/
00002 
00003 #ifndef  VARIABLE_H
00004 #define VARIABLE_H
00005 
00006 #include "mbed.h"
00007 
00008 //robot static body variable
00009 //[0] : x position
00010 //[1] : y position
00011 //[2] : orientation
00012 float *robot_geometry;
00013 float theta_from_compass;
00014 
00015 float theta_target = 0.0; 
00016 float theta_shagai = 0.0;
00017 float count_reset_arm = 0.0;
00018 
00019 //robot kinetic variable
00020 //[0] left_top
00021 //[1] right_top
00022 //[3] left_back
00023 //[4] right_back
00024 float *wheels_target_velocity;
00025 float left_top_vel;
00026 float right_top_vel;
00027 float left_back_vel;
00028 float right_back_vel;
00029 
00030 float linear_velocity;
00031 float rotation_velocity;
00032 float manual_alpha;
00033 
00034 int state_condition;
00035 bool up;
00036 //Timer Variable
00037 Timer timer;
00038 unsigned long prev_compass_timer;
00039 unsigned long prev_motor_timer;
00040 unsigned long prev_pneumatic_timer;
00041 unsigned long prev_stick_timer;
00042 unsigned long prev_stick_symbol_timer;
00043 
00044 /***********************************************************************/
00045 //Struct for setpoint mapping
00046 typedef struct map {
00047     int n;
00048     float x_pos[10];
00049     float y_pos[10];
00050     float theta_pos[10];
00051     float x_offset[10];
00052     float y_offset[10];
00053 } mapping;
00054 
00055 const mapping map_NULL =    {  0,
00056                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
00057                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
00058                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
00059                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
00060                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0}};
00061 
00062 const mapping red_field =   {  0,
00063                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
00064                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
00065                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
00066                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
00067                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0}};
00068 
00069 const mapping blue_field =   {  0,
00070                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
00071                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
00072                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
00073                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
00074                             {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0}};
00075 
00076 mapping map_data = map_NULL;
00077 
00078 #endif