igibson.physics package


igibson.physics.motor module

This file implements an accurate motor model.

class igibson.physics.motor.MotorModel(torque_control_enabled=False, kp=1.2, kd=0)

Bases: object

The accurate motor model, which is based on the physics of DC motors.

The motor model support two types of control: position control and torque control. In position control mode, a desired motor angle is specified, and a torque is computed based on the internal motor model. When the torque control is specified, a pwm signal in the range of [-1.0, 1.0] is converted to the torque.

The internal motor model takes the following factors into consideration: pd gains, viscous friction, back-EMF voltage and current-torque profile.

convert_to_torque(motor_commands, current_motor_angle, current_motor_velocity)

Convert the commands (position control or torque control) to torque.

  • motor_commands – The desired motor angle if the motor is in position control mode. The pwm signal if the motor is in torque control mode.

  • current_motor_angle – The motor angle at the current time step.

  • current_motor_velocity – The motor velocity at the current time step.

Return actual_torque

The torque that needs to be applied to the motor.

Return observed_torque

The torque observed by the sensor.


Module contents