| Description | Hierarchy | Fields | Methods | Properties |
type TBody = class(TTenaciousObject)
Abstract base class implementing physical properties of a TRobot. When defining a robot body, be sure to implement (and override) all virtual methods in this class. See also TDifferentiallySteeredBody which is a concrete class (derived from this class).
Together with the class TBrain, TBody constitutes the fundamental parts of a physical robot (TRobot).
| Name | Description | |
|---|---|---|
![]() |
f3DStructure |
Object containing the graphical representation of the body (user-defined). See T3DStructure. |
![]() |
fBattery |
The robot's energy source (battery). |
![]() |
fCollisionGeometry |
Geometry to use when checking for collisions. See descendants of the TShape-class for available geometry. |
![]() |
fCoordinates |
Object containing the position, velocity, direction of heading, and angular velocity of the body. See TCoordinates. |
![]() |
fDistanceTraveled |
Distance (in meters) that the body has traveled. |
![]() |
fInitialPos |
3D vector containing the initial position of the body. |
![]() |
fMotors |
Container object for motors (see TMotors). |
![]() |
fSensors |
Container object for sensors (see TSensors). |
![]() |
constructor Create(BodyParameters: TBodyParameters); overload; virtual; |
![]() |
constructor Create; overload; override; |
![]() |
constructor CreateAndSet(Body: TBody); virtual; |
![]() |
destructor Destroy; override; |
![]() |
procedure ComputeMotorTorques; virtual; abstract; |
![]() |
function Copy: TBody; virtual; |
![]() |
procedure Generate3DStructure; virtual; abstract; |
![]() |
function Get3DStructure: T3DStructure; virtual; abstract; |
![]() |
function GetPosition: TVector; virtual; abstract; |
![]() |
procedure Initialize; virtual; |
![]() |
procedure LoadFromDefinition(ObjDef: TObjectDefinition); virtual; |
![]() |
procedure Move(TimeStep: real; const Arena: TArena); virtual; abstract; |
![]() |
procedure Reset; virtual; |
![]() |
procedure Update3DStructure; virtual; abstract; |
![]() |
constructor Create(BodyParameters: TBodyParameters); overload; virtual; |
Constructor
![]() |
constructor Create; overload; override; |
Constructor
![]() |
constructor CreateAndSet(Body: TBody); virtual; |
Copy constructor
A copy of the supplied body (Body).
![]() |
destructor Destroy; override; |
Destructor
![]() |
procedure ComputeMotorTorques; virtual; abstract; |
Procedure for computing the torques produced by the motors (fMotors). The torque produced by the motors is commonly used during the integration of the forward dynamics (see the procedure Move).
![]() |
function Copy: TBody; virtual; |
Creates a copy of the body by calling the copy constructor CreateAndSet.
A copy of the body.
![]() |
procedure Generate3DStructure; virtual; abstract; |
Procedure that creates the 3D geometry representing the body and stores the result in the variable f3DStructure.
![]() |
function Get3DStructure: T3DStructure; virtual; abstract; |
Provides access to the variable f3DStructure. Classes deriving from TBody are required to return a valid reference and since the variable f3DStructure is destroyed when calling Reset, a suitable implementation of this function is (assuming a derived class called TMyBody):
function TMyBody.Get3DStructure: T3DStructure; begin if f3DStructure = nil then Generate3DStructure; Result := f3DStructure; end;
The variable f3DStructure.
![]() |
function GetPosition: TVector; virtual; abstract; |
Provides read access of the vector fCoordinates.Position.
![]() |
procedure Initialize; virtual; |
Initialization of member variables (commonly done prior to simulation). Currently, this procedure is only responsible for mapping a battery sensor to the actual energy source (as defined in the definition file).
![]() |
procedure LoadFromDefinition(ObjDef: TObjectDefinition); virtual; |
Procedure for processing the definition of a body (as parsed from the definition text file). This procedure is automatically called from link(Robot.TRobot).LoadFromFile and does not need to be called explicitly.
![]() |
procedure Move(TimeStep: real; const Arena: TArena); virtual; abstract; |
Procedure called every time step and should be used for updating the body's position and integrating the forward dynamics etc. This procedure is called from within the procedure TRobot.Move and does not need to be called explicitly.
![]() |
procedure Reset; virtual; |
Procedure for re-setting member variables. Currently, this procedure resets all sensors by calling TSensors.Reset, sets fDistanceTraveled to zero, sets the position back to it's initial values, and calls fBattery.Initialize (if there is a battery). In addition, the variable f3DStructure is destroyed and set to Nil (see Get3DStructure).
![]() |
procedure Update3DStructure; virtual; abstract; |
Updates the 3D representation of the body (needs to be implemented in derived classes). Updates the variable f3DStructure that provides the connection between the internal geometric representation and the graphical representation used by GLScene.
![]() |
property Battery: TEnergySource; |
![]() |
property CollisionGeometry: TShape; |
![]() |
property Coordinates: TCoordinates; |
![]() |
property DistanceTraveled: real; |
![]() |
property InitialPosition: TVector; |
![]() |
property Motors: TMotors; |
![]() |
property Sensors: TSensors; |
![]() |
property Battery: TEnergySource; |
Provides read access of fBattery.
![]() |
property CollisionGeometry: TShape; |
Provides read access of fCollisionGeometry.
![]() |
property Coordinates: TCoordinates; |
Provides read access of fCoordinates.
![]() |
property DistanceTraveled: real; |
Provides read access of the variable fDistanceTraveled.
![]() |
property InitialPosition: TVector; |
Provides read access of the 3D vector fInitialPos.
![]() |
property Motors: TMotors; |
Provides read access of fMotors.
![]() |
property Sensors: TSensors; |
Provides read access of fSensors.