original_docstring:  create constraint on ankle position and orientation 
docstring: create constraint on ankle position and orientation
docstring_tokens: create constraint on ankle position and orientation
code: def create_ankle_constraints_from_heel_and_toe(self, frames, ankle_joint_name, heel_joint_name, start_frame, end_frame):
          """ create constraint on ankle position and orientation """
          constraints = dict()
          ct = get_average_joint_position(self.skeleton, frames, heel_joint_name, start_frame, end_frame)
          ct[1] = self.scene_interface.get_height(ct[0], ct[2])
          pa = get_average_joint_position(self.skeleton, frames, ankle_joint_name, start_frame, end_frame)
          ph = get_average_joint_position(self.skeleton, frames, heel_joint_name, start_frame, end_frame)
          delta = ct - ph
          ca = pa + delta
          avg_direction = None
          if len(self.skeleton.nodes[ankle_joint_name].children) > 0:
              child_joint_name = self.skeleton.nodes[ankle_joint_name].children[0].node_name
              avg_direction = get_average_joint_direction(self.skeleton, frames, ankle_joint_name, child_joint_name,
                                                          start_frame, end_frame)
          #print "constraint ankle at",pa, ct,ca, start_frame, end_frame, avg_direction
          for frame_idx in range(start_frame, end_frame):
              c = MotionGroundingConstraint(frame_idx, ankle_joint_name, ca, avg_direction)
              constraints[frame_idx] = []
              constraints[frame_idx].append(c)
          return constraints
code_tokens: def create_ankle_constraints_from_heel_and_toe ( self , frames , ankle_joint_name , heel_joint_name , start_frame , end_frame ) : constraints = dict ( ) ct = get_average_joint_position ( self . skeleton , frames , heel_joint_name , start_frame , end_frame ) ct [ 1 ] = self . scene_interface . get_height ( ct [ 0 ] , ct [ 2 ] ) pa = get_average_joint_position ( self . skeleton , frames , ankle_joint_name , start_frame , end_frame ) ph = get_average_joint_position ( self . skeleton , frames , heel_joint_name , start_frame , end_frame ) delta = ct - ph ca = pa + delta avg_direction = None if len ( self . skeleton . nodes [ ankle_joint_name ] . children ) > 0 : child_joint_name = self . skeleton . nodes [ ankle_joint_name ] . children [ 0 ] . node_name avg_direction = get_average_joint_direction ( self . skeleton , frames , ankle_joint_name , child_joint_name , start_frame , end_frame ) for frame_idx in range ( start_frame , end_frame ) : c = MotionGroundingConstraint ( frame_idx , ankle_joint_name , ca , avg_direction ) constraints [ frame_idx ] = [ ] constraints [ frame_idx ] . append ( c ) return constraints
short_docstring: create constraint on ankle position and orientation
short_docstring_tokens: create constraint on ankle position and orientation
comment: """ create constraint on ankle position and orientation """$SEP$#print "constraint ankle at",pa, ct,ca, start_frame, end_frame, avg_direction