Skip to content
Snippets Groups Projects
Commit ba5a8447 authored by ft-Demo's avatar ft-Demo
Browse files

commit by robo pro coding

parent b1e596ef
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -220,8 +220,8 @@ def turnSideLeft(v, ticks):
global factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, factor_y, posx_ball, posx_goal_left, posx_goal_right, counters, factor_ball_rot, posy_ball, search_dir_left, x_min, v_var_ball_xpos, x_max, v_var_ball_ypos, y_ball_far, y_ball_near, y_ball_touch, v_slow, v_fast, goal_width, pos_goal_both, state
cmd = 'turnSideLeft'
if ticks >= 1:
TXT_M_M1_encodermotor.set_speed(int(0), Motor.CCW)
TXT_M_M2_encodermotor.set_speed(int(0), Motor.CW)
TXT_M_M1_encodermotor.set_speed(int(100), Motor.CCW)
TXT_M_M2_encodermotor.set_speed(int(100), Motor.CW)
TXT_M_M1_encodermotor.set_distance(int(ticks), TXT_M_M2_encodermotor)
TXT_M_M3_encodermotor.set_speed(int(v), Motor.CW)
TXT_M_M4_encodermotor.set_speed(int(v), Motor.CCW)
......@@ -236,8 +236,8 @@ def turnSideRight(v, ticks):
global factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, factor_y, posx_ball, posx_goal_left, posx_goal_right, counters, factor_ball_rot, posy_ball, search_dir_left, x_min, v_var_ball_xpos, x_max, v_var_ball_ypos, y_ball_far, y_ball_near, y_ball_touch, v_slow, v_fast, goal_width, pos_goal_both, state
cmd = 'turnSideRight'
if ticks >= 1:
TXT_M_M1_encodermotor.set_speed(int(0), Motor.CW)
TXT_M_M2_encodermotor.set_speed(int(0), Motor.CCW)
TXT_M_M1_encodermotor.set_speed(int(100), Motor.CW)
TXT_M_M2_encodermotor.set_speed(int(100), Motor.CCW)
TXT_M_M1_encodermotor.set_distance(int(ticks), TXT_M_M2_encodermotor)
TXT_M_M3_encodermotor.set_speed(int(v), Motor.CCW)
TXT_M_M4_encodermotor.set_speed(int(v), Motor.CW)
......@@ -361,7 +361,6 @@ state = 'NONE'
cmd = 'NONE'
time.sleep(2)
while True:
checkTimeouts()
if display.get_attr("txt_switch_active.checked"):
if posx_ball != None and posy_ball != None and posx_goal_left == None and posx_goal_right == None:
state = 'BALL_NO_GOAL'
......@@ -457,6 +456,7 @@ while True:
display.set_attr("txt_label_goal.text", str('x:{}, {}, p:{}, w:{}'.format(posx_goal_left, posx_goal_right, pos_goal_both, goal_width)))
display.set_attr("txt_label_counters.text", str('{}'.format(counters)))
print('{}:{} GOAL_x: {}, {}, p:{}, w:{} BALL_pos:{},{} v_x:{} v_y:{}'.format(state, cmd, posx_goal_left, posx_goal_right, pos_goal_both, goal_width, posx_ball, posy_ball, v_var_ball_xpos, v_var_ball_ypos))
checkTimeouts()
time.sleep(0.08)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment