Polarith AI
1.8
Spaceship Controller

This controller inherits from RpyController and serves as an example of how to use the 3D sensor together with Context for transforming the made decisions into meaningful steering values. This controller shall enable an agent to use all 6 degree of freedoms (DoF). To move the agent, combine this controller with a physics component, e.g., SpaceshipPhysics (see below) or one that you created by yourself. The controller itself will not apply any force to the agent but yields steering values.

Properties

This component has got the following specific properties.

Property Description
Context Reference to the Context component to provide decision information that will be transformed into roll, pitch and yaw.
Body Reference to the rigidbody that is used by the physics component to move the agent.
UsePidController Enables the PID controller which are used after roll, pitch, and yaw are calculated.
Roll Proportional (P), integral (I), and derivative (D) part of the PID controller for roll.
Pitch Proportional (P), integral (I), and derivative (D) part of the PID controller for pitch.
Yaw Proportional (P), integral (I), and derivative (D) part of the PID controller for yaw.

Preview

Spaceship Physics

SpaceshipPhysics is a component that applies the rotation and force values of the controller to a rigidbody. Since the spaceship can use all 6 DoF, applying these values is all that it takes. Additionally, Torque and Speed can be adjusted to fit the movement to the scenario.

Property Description
TorqueDetermines the maximum angular force which is applied. This parameter depends on the Angular Drag of the attached rigidbody.
Speed Determines the maximum linear force which is applied. This parameter depends on the Drag of the attached rigidbody
Spaceship Controller Controller to obtain steering values.

Remarks

To make use of this controller and physics component, do not forget to disable Use Gravity in the attached rigidbody.

Imprint