0

Hej,

I want to get the cycle time between two starts detected through this if statement. This approach however results in ms. If I manually compare the time between starts with the output it's within 2-3s. Would appreciate some help!

        counter = 0
        stage = "start"
        diff = 0
        wrist_y = landmarks[mp_pose.PoseLandmark.RIGHT_WRIST.value].y

        if wrist_y < 0.3 and stage == "start":
            start_time = time.time()
            stage = "running"

        if wrist_y >= 0.3 and stage == "running":              
            end_time = time.time()
            diff = end_time - start_time
            diff = round(diff, 2)
            stage = "start"
            counter += 1
Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
Hansson
  • 112
  • 6
  • welcome. [mre] required. please clarify. give figures (numbers). debug your code properly. explain what you understand about your code and what you _don't_ understand about it. – Christoph Rackwitz Sep 01 '23 at 14:58

0 Answers0