Beispiel #1
0
 def check_down_position(self, hip_y_position, knee_y_position,
                         shoulder_y_position, wrist_y_position,
                         elbow_y_position):
     print(hip_y_position, knee_y_position, shoulder_y_position,
           elbow_y_position)
     if (hip_y_position > knee_y_position or check_close5(
             hip_y_position, knee_y_position)) and check_close(
                 shoulder_y_position, elbow_y_position):
         self.logger.debug("Good down position: " + str(hip_y_position) +
                           " - " + str(knee_y_position))
         return True
     else:
         self.logger.debug("Bad down position: " + str(hip_y_position) +
                           " - " + str(knee_y_position))
         return False
Beispiel #2
0
    def check_if_still_going_down(self, hip_y_position, iteration):
        bigger_points = 0
        # check next 5 frames
        for i in range(0, 5):
            if (iteration + i + 1) >= self.json_reader.number_of_files:
                return False
            else:
                point, trust = self.json_reader.get_values(
                    iteration + i + 1, (HIP_VALUE, ))
                if point[1] <= hip_y_position or check_close5(
                        point[1], hip_y_position):
                    bigger_points += 1

                hip_y_position = point[1]

        if bigger_points >= 3:
            return True

        return False