@sh.add_function(
dsp, inputs=['motor_p4_front_powers', 'motor_p4_front_speeds'],
outputs=['motor_p4_front_torques']
)
@sh.add_function(
dsp, inputs=['motor_p4_rear_powers', 'motor_p4_rear_speeds'],
outputs=['motor_p4_rear_torques']
)
def calculate_motor_p4_torques(motor_p4_powers, motor_p4_speeds):
"""
Calculates torque at motor P4 [N*m].
:param motor_p4_powers:
Power at motor P4 [kW].
:type motor_p4_powers: numpy.array | float
:param motor_p4_speeds:
Rotating speed of motor P4 [RPM].
:type motor_p4_speeds: numpy.array | float
:return:
Torque at motor P4 [N*m].
:rtype: numpy.array | float
"""
from ...wheels import calculate_wheel_torques
return calculate_wheel_torques(motor_p4_powers, motor_p4_speeds)