(self, leg_id, contact_force)
return motor_torques
Maps the foot contact force to the leg joint torques.
Maps the foot contact force to the leg joint torques.
Maps the foot contact force to the leg joint torques .
def MapContactForceToJointTorques(self, leg_id, contact_force):
    """Maps the foot contact force to the leg joint torques."""
    jv = self.ComputeJacobian(leg_id)
    all_motor_torques = np.matmul(contact_force, jv)
    motor_torques = {}
    motors_per_leg = self.num_motors // self.num_legs
    com_dof = 6
    for joint_id in range(leg_id * motors_per_leg,
                          (leg_id + 1) * motors_per_leg):
      motor_torques[joint_id] = all_motor_torques[
          com_dof + joint_id] * self._motor_direction[joint_id]

    return motor_torques
def MapContactForceToJointTorques ( self , leg_id , contact_force ) : jv = self . ComputeJacobian ( leg_id ) all_motor_torques = np . matmul ( contact_force , jv ) motor_torques = { } motors_per_leg = self . num_motors // self . num_legs com_dof = 6 for joint_id in range ( leg_id * motors_per_leg , ( leg_id + 1 ) * motors_per_leg ) : motor_torques [ joint_id ] = all_motor_torques [ com_dof + joint_id ] * self . _motor_direction [ joint_id ] return motor_torques