(self, leg_id, contact_force)
return motor_torques_dict
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)
    motor_torques_list = np.matmul(contact_force, jv)
    motor_torques_dict = {}
    motors_per_leg = self.num_motors // self.num_legs
    for torque_id, joint_id in enumerate(
        range(leg_id * motors_per_leg, (leg_id + 1) * motors_per_leg)):
      motor_torques_dict[joint_id] = motor_torques_list[torque_id]
    return motor_torques_dict
def MapContactForceToJointTorques ( self , leg_id , contact_force ) : jv = self . ComputeJacobian ( leg_id ) motor_torques_list = np . matmul ( contact_force , jv ) motor_torques_dict = { } motors_per_leg = self . num_motors // self . num_legs for torque_id , joint_id in enumerate ( range ( leg_id * motors_per_leg , ( leg_id + 1 ) * motors_per_leg ) ) : motor_torques_dict [ joint_id ] = motor_torques_list [ torque_id ] return motor_torques_dict