This is a physics-based controller to create a copter-like behavior. Typically, a copter will only move towards its normal vector. Moving in a particular direction is achieved by tilting towards this direction.
The goal of this controller is to transform the DecidedDirection
into appropriate roll, pitch, yaw and thrust values. A rigidbody needs to be attached to enable the hovering of the copter since its mass needs to be known.
To move the agent, combine this controller with a physics component, e.g., CopterPhysics (see below) or one that you created on your own. The controller itself will not apply any force to the agent, but yields steering values.
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. |
ObservationPoint | The copter´s heading will face towards this point if FlightMode.ObservationPoint is active. |
FlightMode | The flight mode in which the copter will operate. For more information about the modes see the FlightMode within the package sources. |
SpeedFactor | This value increases the speed the copter tries to achieve. However, its effect is limited by the internal angle threshold. |
RollFactor | By default, the roll value will range from -1 to 1. Use this factor to increase the roll value and, thus, the force that moves the copter sideways. |
PitchFactor | By default, the pitch value will range from -1 to 1. Use this factor to increase the pitch value and, thus, the force that moves the copter forward/backward. |
YawFactor | The calculation of yaw depends on the FlightMode . If a mode defines a viewpoint, yaw will turn the copter´s heading towards this viewpoint. Use this factor to increase the yaw value and thus the speed the copter turns around itself. |
ThrustFactor | By default, the thrust value will range from -1 to 1. Use this factor to increase the thrust value and, thus, the force that moves the copter up/down. |
RollFactor
, PitchFactor
, and YawFactor
should not be set greater than 70 since they also serve as a limit for the appropriate rotation. A value greater than this can cause an oversteering of the copter and, thus, lead to unexpected behavior.
The SpeedFactor
increases the overall velocity of the copter but at the cost of its accuracy. In the example scenarios, a value between 1 and 10 yields good results.
CopterPhysics
is a component that applies the force and rotation values of the controller to a rigidbody. The rotation values are applied as a relative torque.
Property | Description |
---|---|
CopterController | Controller to obtain steering values. |