Page 283 - Robot Design Handbook ROBOCON Malaysia 2019
P. 283
START
A
SET CONSTANT FOR SERVO const float spot_turn_speed = 40;
CytronServoShield servo1; const float leg_move_speed = 100;
CytronServoShield servo2; const float body_move_speed = 80;
CytronServoShield servo3; const float stand_seat_speed = 40;
CytronServoShield servo4; const float gyrate_speed = 0.8;
const int ser vo_pin[4][3] = { {2, 3, 4}, {5, 6, const float bow_speed = 1;
7}, {8, 9, 10}, {11, 12, 13} }; volatile int rest_counter;
SET CONSTANT FOR SIZE OF ROBOT
const float KEEP = 255;
const float length_a = 85; const float pi = 3.1415926;
const float length_b = 245; volatile float site_cg[4][3];
const float length_c = 45;
const float robot_side_length = 70.84;
const float length_side = 210; const float robot_front_length = 77.92;
const float z_absolute = -250; const float robot_centre_to_pivot =
const int WALK = 0; sqrt(pow(robot_side_length / 2, 2) +
const int RELAX = 1; pow(robot_front_length / 2, 2));
const int SP RAWL = 2; const float move_angle = 15;
const bool FALSE = 0; const float temp_hyp = sqrt(pow(x_default -
x_offset, 2) + pow(y_start + y_step, 2)) +
const bool TRUE = 1; robot_centre_to_pivot;
volatile float site_now[4][3];
const float angle_1 = atan((y_start + y_step, 2) /
volatile float angle_expect[4][3]; (x_default - x_offset, 2));
volatile float site_expect[4][3]; const float move_x1 = temp_hyp * cos(angle_1
volatile bool capture = true; - move_angle);
float temp_speed[4][3]; const float move_y1 = temp_hyp * sin(angle_1 -
move_angle);
float move_speed;
float speed_multiple = 1; const float move_x2 = temp_hyp * cos(angle_1
+ move_angle);
int leg_position
const float move_y2 = temp_hyp * sin(angle_1
+ move_angle);
const float half_step = 10;
const float cg_shift = 14;
Figure 5: Flow-chart of the programme
3.0 PRESENTATION OF DATA
No simulation is done during the development process as the method we use is a
trial and error one.
279

