original_docstring:  create a constraint on the ankle position based on the toe constraint position
docstring: create a constraint on the ankle position based on the toe constraint position
docstring_tokens: create a constraint on the ankle position based on the toe constraint position
code: def generate_grounding_constraint_from_toe(self, frames, ankle_joint_name, toe_joint_name, frame_idx, end_frame):
          """ create a constraint on the ankle position based on the toe constraint position"""
          #print "add toe constraint"
          ct = self.get_previous_joint_position_from_buffer(frames, frame_idx, end_frame, toe_joint_name)
          ct[1] = self.scene_interface.get_height(ct[0], ct[2])  # set toe constraint on the ground
          a = self.skeleton.nodes[ankle_joint_name].get_global_position(frames[frame_idx])
          t = self.skeleton.nodes[toe_joint_name].get_global_position(frames[frame_idx])
  
          target_toe_offset = a - t  # difference between unmodified toe and ankle at the frame
          ca = ct + target_toe_offset  # move ankle so toe is on the ground
          constraint = MotionGroundingConstraint(frame_idx, ankle_joint_name, ca, None, None)
  
          constraint.toe_position = ct
          constraint.global_toe_offset = target_toe_offset
          return constraint
code_tokens: def generate_grounding_constraint_from_toe ( self , frames , ankle_joint_name , toe_joint_name , frame_idx , end_frame ) : ct = self . get_previous_joint_position_from_buffer ( frames , frame_idx , end_frame , toe_joint_name ) ct [ 1 ] = self . scene_interface . get_height ( ct [ 0 ] , ct [ 2 ] ) a = self . skeleton . nodes [ ankle_joint_name ] . get_global_position ( frames [ frame_idx ] ) t = self . skeleton . nodes [ toe_joint_name ] . get_global_position ( frames [ frame_idx ] ) target_toe_offset = a - t ca = ct + target_toe_offset constraint = MotionGroundingConstraint ( frame_idx , ankle_joint_name , ca , None , None ) constraint . toe_position = ct constraint . global_toe_offset = target_toe_offset return constraint
short_docstring: create a constraint on the ankle position based on the toe constraint position
short_docstring_tokens: create a constraint on the ankle position based on the toe constraint position
comment: """ create a constraint on the ankle position based on the toe constraint position"""$SEP$#print "add toe constraint"$SEP$# set toe constraint on the ground$SEP$# difference between unmodified toe and ankle at the frame$SEP$# move ankle so toe is on the ground