(self)
return 0.5*(upper_dist + lower_dist)
Returns the distance from the ball to the mouth.
Returns the distance from the ball to the mouth.
Returns the distance from the ball to the mouth .
def ball_to_mouth_distance(self):
    """Returns the distance from the ball to the mouth."""
    ball_pos = self.named.data.geom_xpos['ball']
    upper_bite_pos = self.named.data.site_xpos['upper_bite']
    lower_bite_pos = self.named.data.site_xpos['lower_bite']
    upper_dist = np.linalg.norm(ball_pos - upper_bite_pos)
    lower_dist = np.linalg.norm(ball_pos - lower_bite_pos)
    return 0.5*(upper_dist + lower_dist)
def ball_to_mouth_distance ( self ) : ball_pos = self . named . data . geom_xpos [ 'ball' ] upper_bite_pos = self . named . data . site_xpos [ 'upper_bite' ] lower_bite_pos = self . named . data . site_xpos [ 'lower_bite' ] upper_dist = np . linalg . norm ( ball_pos - upper_bite_pos ) lower_dist = np . linalg . norm ( ball_pos - lower_bite_pos ) return 0.5 * ( upper_dist + lower_dist )