Package populus :: Module MotionModel :: Class SimpleHumanBody
[frames] | no frames]

Class SimpleHumanBody


Base class for reactive agents that realizes the dynamics and kinematic of a simple human body.

The body is simple because it allows only for limited movements. In fact the motion is modeled as a point mass plus head and eyes rotations.

Instance Methods

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

    Constructor and Destructor
 
__init__(self)
The constructor creates an instance of SimpleHumanBody with all its attributes set to zero.
 
remove(self)
Destroy this instance of SimpleHumanBody.
    Getters and Setters
Vec3
side(self)
Side vector of the whole body.
Vec3
forward(self)
Forward vector of the whole body.
Vec3
up(self)
The up vector of the whole body.
Point3
position(self)
Position of the whole body in global coordinates.
Mat3
orientation(self)
Orientation matrix of the whole body in global coordinates.
Mat4
bodyMat(self)
Transformation matrix of the whole body in global coordinates.
float
heading(self)
Heading angle of the whole body.
float
pitch(self)
Pitch angle of the whole body.
float
roll(self)
Roll angle of the whole body.
float
height(self)
Height of the whole body.
float
radius(self)
Radius of the whole body.
float
speed(self)
Speed of the whole body.
Vec3
velocity(self)
Velocity vector of the whole body.
float
mass(self)
Mass of the whole body.
float
maxSpeed(self)
Max speed reachable by the whole body.
float
maxForce(self)
Max force applicable to the whole body.
float
turning(self)
Angular speed of the whole body.
float
maxAngSpeed(self)
Max angular speed reachable by the whole body.
Vec3
headSide(self)
Side vector of the head in global coordinates.
Vec3
headForward(self)
Forward vector of the head in global coordinates.
Vec3
headUp(self)
Up vector of the head in global coordinates.
Point3
headPosition(self)
Position of the head in global coordinates.
Point3
headLocalPos(self)
Position of the head in local coordinates.
Mat3
headRotation(self)
Rotation matrix of the head in global coordinates.
Mat4
headMat(self)
Matrix of the head in the global coordinates.
Mat4
headLocalMat(self)
Matrix of the head in local coordinates.
float
headRadius(self)
Radius of the head.
float
headTurning(self)
Angular speed of the head.
float
headMaxAngSpeed(self)
Max angular speed of the head.
float
headMaxAngExt(self)
Max horizontal angular extension in head rotation.
Vec3
eyesSide(self)
Side vector of the eyes global coordinates.
Vec3
eyesForward(self)
Forward vector of the eyes in global coordinates.
Vec3
eyesUp(self)
Up vector of the eyes in global coordinates.
Point3
eyesPosition(self)
Position of the eyes in global coordinates.
Point3
eyesLocalPos(self)
Position of the eyes in local coordinates.
Mat3
eyesRotation(self)
Rotation matrix of the eyes in global coordinates.
Mat4
eyesMat(self)
Matrix of the eyes in global coordinates.
Mat4
eyesLocalMat(self)
Matrix of the eyes local coordinates.
float
eyesMaxAngExt(self)
Max angular extension for eyes rotation both vertical and horizontal.
float
eyesMaxAngSpeed(self)
Max angular speed of the eyes.
 
setMass(self, m)
Set the whole body mass.
 
setRadius(self, r)
Set the whole body radius.
 
setHeight(self, h)
Set the whole body height.
 
setPosition(self, p)
Set the body global position.
 
setHeading(self, h)
Set body heading.
 
setPitch(self, p)
Set body pitch.
 
setRoll(self, r)
Set body roll.
 
setVelocity(self, v)
Set the body velocity vector.
 
setTurning(self, alpha)
Set the body angular speed.
 
setMaxForce(self, max)
Set max force applicable to the body.
 
setMaxSpeed(self, max)
Set the body max speed.
 
setMaxAngSpeed(self, max)
Set the body max angular speed.
 
setHeadRadius(self, r)
Set head radius.
 
setHeadTurning(self, alpha)
Set head angular velocity.
 
setHeadPosition(self, p)
Set head global position.
 
setHeadLocalPos(self, p)
Set the head position relative to the body.
 
setHeadMaxAngSpeed(self, max)
Set the head max angular speed.
 
setHeadMaxAngExt(self, max)
Set max horizontal angular extension for head rotation.
 
setEyesPosition(self, p)
Set eyes global position.
 
setEyesLocalPos(self, p)
Set eyes position relative to the head.
 
setEyesMaxAngExt(self, max)
Set vertical and horizontal max angular extension for eyes rotation.
 
setEyesMaxAngSpeed(self, max)
Set eyes max angular speed.
 
setBodyMotionMotivation(self, value)
Receptor for body linear motion motivations.
 
setBodyDirectionMotivation(self, value)
Receptor for body directional motivations.
 
setHeadDirectionMotivation(self, value)
Receptor for head directional motivations.
 
setEyesDirectionMotivation(self, value)
Receptor for eyes directional motivations.
    Update
 
update(self, dt)
Update the SimpleHumanBody.
Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

 

The constructor creates an instance of SimpleHumanBody with all its attributes set to zero.

Overrides: object.__init__

side(self)

 

Side vector of the whole body.

Returns: Vec3
The side vector.

forward(self)

 

Forward vector of the whole body.

Returns: Vec3
The forward vector.

up(self)

 

The up vector of the whole body.

Returns: Vec3
The up vector.

position(self)

 

Position of the whole body in global coordinates.

Returns: Point3
The global position.

orientation(self)

 

Orientation matrix of the whole body in global coordinates.

Returns: Mat3
The global orientation matrix.

bodyMat(self)

 

Transformation matrix of the whole body in global coordinates.

Returns: Mat4
The global transformation matrix.

heading(self)

 

Heading angle of the whole body.

Returns: float
The heading angle in degree.

pitch(self)

 

Pitch angle of the whole body.

Returns: float
The pitch angle in degree.

roll(self)

 

Roll angle of the whole body.

Returns: float
The roll angle in degree.

height(self)

 

Height of the whole body.

Returns: float
The height in meters.

radius(self)

 

Radius of the whole body.

Returns: float
The radius in meters.

speed(self)

 

Speed of the whole body.

Returns: float
The speed in m/s.

velocity(self)

 

Velocity vector of the whole body.

Returns: Vec3
The velocity vector.

mass(self)

 

Mass of the whole body.

Returns: float
The mass in kg.

maxSpeed(self)

 

Max speed reachable by the whole body.

Returns: float
The max speed in m/s.

maxForce(self)

 

Max force applicable to the whole body.

Returns: float
The max force in Newtons.

turning(self)

 

Angular speed of the whole body.

Returns: float
The angular speed in deg/s.

maxAngSpeed(self)

 

Max angular speed reachable by the whole body.

Returns: float
The max angular speed in deg/s.

headSide(self)

 

Side vector of the head in global coordinates.

Returns: Vec3
The global side vector for the head.

headForward(self)

 

Forward vector of the head in global coordinates.

Returns: Vec3
The global forward vector for the head.

headUp(self)

 

Up vector of the head in global coordinates.

Returns: Vec3
The global up vector for the head.

headPosition(self)

 

Position of the head in global coordinates.

Returns: Point3
The global position of the head.

headLocalPos(self)

 

Position of the head in local coordinates.

Returns: Point3
The position of the head relative to the body.

headRotation(self)

 

Rotation matrix of the head in global coordinates.

Returns: Mat3
The global rotation matrix for the head.

Attention: Not Implemented.

headMat(self)

 

Matrix of the head in the global coordinates.

Returns: Mat4
Global matrix for the head.

headLocalMat(self)

 

Matrix of the head in local coordinates.

Returns: Mat4
Local matrix for the head.

headRadius(self)

 

Radius of the head.

Returns: float
Head's radius in meters.

headTurning(self)

 

Angular speed of the head.

Returns: float
Head's angular speed in deg/s.

headMaxAngSpeed(self)

 

Max angular speed of the head.

Returns: float
Head's max angular speed in deg/s.

headMaxAngExt(self)

 

Max horizontal angular extension in head rotation.

Returns: float
Max horizontal head's angular extension in degree.

eyesSide(self)

 

Side vector of the eyes global coordinates.

Returns: Vec3
The global side vector for the eyes.

eyesForward(self)

 

Forward vector of the eyes in global coordinates.

Returns: Vec3
The global forward vector for the eyes.

eyesUp(self)

 

Up vector of the eyes in global coordinates.

Returns: Vec3
The global up vector for the eyes.

eyesPosition(self)

 

Position of the eyes in global coordinates.

Returns: Point3
The global position of the eyes relative to body.

eyesLocalPos(self)

 

Position of the eyes in local coordinates.

Returns: Point3
The local position of the eyes.

eyesRotation(self)

 

Rotation matrix of the eyes in global coordinates.

Returns: Mat3
The eyes global rotation matrix.

Attention: Not Implemented.

eyesMat(self)

 

Matrix of the eyes in global coordinates.

Returns: Mat4
The eyes global matrix.

eyesLocalMat(self)

 

Matrix of the eyes local coordinates.

Returns: Mat4
The eyes local matrix.

eyesMaxAngExt(self)

 

Max angular extension for eyes rotation both vertical and horizontal.

Returns: float
The max angular extension in degree.

eyesMaxAngSpeed(self)

 

Max angular speed of the eyes.

Returns: float
The max angular speed in deg/s.

setMass(self, m)

 

Set the whole body mass.

Parameters:
  • m (float) - Mass in kg.

setRadius(self, r)

 

Set the whole body radius.

Parameters:
  • r (float) - Radius in meters.

setHeight(self, h)

 

Set the whole body height.

Parameters:
  • h (float) - Height in meters.

setPosition(self, p)

 

Set the body global position.

Parameters:
  • p (tuple or Point3) - Point in global coordinates.

setHeading(self, h)

 

Set body heading.

Parameters:
  • h (float) - Heading angle in degree.

setPitch(self, p)

 

Set body pitch.

Parameters:
  • p (float) - Pitch angle in degree.

setRoll(self, r)

 

Set body roll.

Parameters:
  • r (float) - Roll angle in degree.

setVelocity(self, v)

 

Set the body velocity vector.

Parameters:
  • v (Vec3) - Velocity vector.

setTurning(self, alpha)

 

Set the body angular speed.

Parameters:
  • alpha (float) - Angular speed in deg/s.

setMaxForce(self, max)

 

Set max force applicable to the body.

Parameters:
  • max (float) - Max force in Newtons.

setMaxSpeed(self, max)

 

Set the body max speed.

Parameters:
  • max (float) - Max speed in m/s.

setMaxAngSpeed(self, max)

 

Set the body max angular speed.

Parameters:
  • max (float) - Max angular speed in deg/s.

setHeadRadius(self, r)

 

Set head radius.

Parameters:
  • r (float) - Head radius in meters

setHeadTurning(self, alpha)

 

Set head angular velocity.

Parameters:
  • alpha (float) - Head angular speed in deg/s.

setHeadPosition(self, p)

 

Set head global position.

Parameters:
  • p (tuple or Point3) - Point in global coordinates.

setHeadLocalPos(self, p)

 

Set the head position relative to the body.

Parameters:
  • p (tuple or Point3) - Point in head local coordinates.

setHeadMaxAngSpeed(self, max)

 

Set the head max angular speed.

Parameters:
  • max (float) - Max head angular speed in degree.

setHeadMaxAngExt(self, max)

 

Set max horizontal angular extension for head rotation.

Parameters:
  • max (float) - Max head angular extension in degree.

setEyesPosition(self, p)

 

Set eyes global position.

Parameters:
  • p (tuple or Point3) - A point in global coordinates.

setEyesLocalPos(self, p)

 

Set eyes position relative to the head.

Parameters:
  • p (tuple or Point3) - A point in eyes local coordinates.

setEyesMaxAngExt(self, max)

 

Set vertical and horizontal max angular extension for eyes rotation.

Parameters:
  • max (float) - Max angular extension in degree.

setEyesMaxAngSpeed(self, max)

 

Set eyes max angular speed.

Parameters:
  • max (float) - Max angular speed in deg/s.

setBodyMotionMotivation(self, value)

 

Receptor for body linear motion motivations.

Parameters:
  • value (Vec3) - A vectorial amount representing the value of a motivation.

setBodyDirectionMotivation(self, value)

 

Receptor for body directional motivations.

Parameters:
  • value (Vec3) - A vectorial amount representing the value of a motivation.

setHeadDirectionMotivation(self, value)

 

Receptor for head directional motivations.

Parameters:
  • value (Vec3) - A vectorial amount representing the value of a motivation.

setEyesDirectionMotivation(self, value)

 

Receptor for eyes directional motivations.

Parameters:
  • value (Vec3) - A vectorial amount representing the value of a motivation.

update(self, dt)

 

Update the SimpleHumanBody.

The motivations from the mind, if any, will be used to generate motion.

Parameters:
  • dt (float) - Delta time since the last simulation step.