Motor

The motor component is a scripted component that implements a servomotor, allowing for precise control of linear or angular position, velocity and acceleration. For further details on all properties associated with this component and how to use this component with scripting, please see the API documentation.

Prismatic and revolute joints can be driven by dynamic motors. You can select an existing motor to be bound to the joint, or click the add button next to the motor property to create a new motor component (attached to the selected entity) that is automatically bound to the joint.

Properties

The motor component properties that are accessible through the inspector.

Type

The type of actuator used. It is one of the following:

  • Angular - An angular motor that produces rotary motion by application of a torque.
  • Linear - A linear motor that produces linear motion by application of a force.

Controller

The module that controls the motor outputs. It is one of the following:

  • Position - Drives the motor from its current position to the target position.
  • Velocity - Drives the motor from its current velocity to the target velocity.

Force Limit

The maximum torque/force that the motor can produce.

Current Position

The current position of the motor. This property can only be viewed through the inspector but cannot be manually changed.

Current Velocity

The current velocity of the motor. This property can only be viewed through the inspector but cannot be manually changed.

State

The state is true if the motor is switched on, and false if the motor is switched off. A motor that is switched off applies no force/torque.

Target Position

The target position for the controller. This property is hidden when a velocity controller is used.

Target Velocity

The target velocity for the controller.

Target Acceleration

The target acceleration for the controller.

Target Deceleration

The target deceleration for the controller.

Stalled

This property if true if the motor has stalled, false otherwise.

Action

The action that the controller should take when a stall is detected. It is one of the following:

  • None - The controller should not detect or act upon stalls.
  • Stop - The controller should stop the motor when a stall is detected.
  • Recover - The controller should attempt to automatically recover when a stall is detected.

Tolerance

The stall tolerance, which is used by the controller to detect stalls. A stall is detected when the stall tolerance is continuously exceeded for the duraction of the stall timeout.

Timeout

The stall timeout is used by the controller to detect stalls. A stall is detected when the stall tolerance is continuously exceeded for the duraction of the stall timeout.