Why isnt my loop finishing? Seeing others see what Im not
when I comment out this loop the program runs fine
def what_is_reward(self):
start_time = time.time()
time_in_right_position = 0
while self.target1 - 1.0 < self.joint1 < self.target1 + 1.0:
time_in_right_position = time.time() - start_time
This loop runs inside this loop, too make the problem more clear
while True:
current_time = time.time()
elapsed_time = current_time - start_time
z = r.give_force()
print("z is", z)
k = r.get_joint()
print("target during game is", g)
print("the joint position is", k)
score += r.what_is_reward()
print("the score during game is", score)
time.sleep(1.7)
print(elapsed_time)
#i +=1
if elapsed_time > seconds:
break