Enki  1.9
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Enki::CircularCam Class Reference

1D Circular camera More...

#include <CircularCam.h>

Inheritance diagram for Enki::CircularCam:
Enki::LocalInteraction

Public Member Functions

 CircularCam (Robot *owner, Vector pos, double height, double orientation, double halfFieldOfView, unsigned pixelCount)
 Constructor. More...
 
virtual ~CircularCam ()
 Destructor.
 
virtual void init (double dt, World *w)
 Init at each step.
 
virtual void objectStep (double dt, World *w, PhysicalObject *po)
 Interact with object. More...
 
virtual void wallsStep (double dt, World *w)
 Interact with walls. More...
 
virtual void finalize (double dt, World *w)
 Finalize at each step.
 
void setRange (double range)
 Change the sight range of the camera.
 
Point getAbsolutePosition (void)
 Return the absolute position (world coordinates) of the camera, updated at each time step on init()
 
double getAbsoluteOrientation (void)
 Return the absolute orientation (world coordinates) of the camera, updated at each time step on init()
 
- Public Member Functions inherited from Enki::LocalInteraction
 LocalInteraction ()
 Constructor.
 
 LocalInteraction (double range, Robot *owner)
 Constructor.
 
virtual ~LocalInteraction ()
 Destructor.
 
double getRange () const
 Return the range of the interaction.
 

Public Attributes

std::valarray< double > zbuffer
 zbuffer: distances at square (array of size pixelCount of double)
 
std::valarray< Colorimage
 Image (array of size pixelCount of Color)
 
double halfFieldOfView
 Field of view = [-halfFieldOfView; + halfFieldOfView]. [0; PI/2].
 
double angleOffset
 Angular offset based on owner angle.
 
bool useFog
 Fog switch, exponential decay of light with distance.
 
double fogDensity
 Density of fog, used to compute light attenuation with the function: light = light0 * exp(-fogDensity * distance)
 
Color lightThreshold
 Minimum incoming light, otherwise 0. Only used if useFog is true.
 
PixelOperationFunctorpixelOperation
 Pointer to active pixel operation.
 

Protected Member Functions

double interpolateLinear (double s0, double s1, double sv, double d0, double d1)
 Return linear interpolated value between d0 and d1, given a sensorvalue sv between s0 and s1.
 
void drawTexturedLine (const Point &p0, const Point &p1, const Texture &texture)
 Draw a textured line from point p0 to p1 using texture - WTF are p0 and p1??
 

Protected Attributes

Vector positionOffset
 Position offset based on owner position.
 
double height
 Height above ground, the camera will not see any object of smaller height.
 
Vector absPos
 Absolute position in the world, updated on init()
 
double absOrientation
 Absolute angle in the world, updated on init()
 
- Protected Attributes inherited from Enki::LocalInteraction
double r
 Radius of the local interaction.
 
Robotowner
 The physical object that owns the interaction.
 

Detailed Description

1D Circular camera

The maximum aperture angle of this camera is PI, so this is not an omnicam. Pixels start at -halfFieldOfView and then follow mathematical orientation

Constructor & Destructor Documentation

Enki::CircularCam::CircularCam ( Robot owner,
Vector  pos,
double  height,
double  orientation,
double  halfFieldOfView,
unsigned  pixelCount 
)

Constructor.

Parameters
ownerrobot this camera is attached to
posposition of this camera on the robot
heightheight of this camera with respect to ground
orientationorientation of this camera with respect to the robot front
halfFieldOfViewhalf aperture of the camera. The real field of view is twice this value [0; PI/2]
pixelCountnumber of pixel to cover the full field of view

References angleOffset, Enki::Color::black, Enki::depthTest, fogDensity, halfFieldOfView, height, lightThreshold, Enki::LocalInteraction::owner, pixelOperation, positionOffset, Enki::LocalInteraction::r, and useFog.

Member Function Documentation

void Enki::CircularCam::objectStep ( double  dt,
World w,
PhysicalObject po 
)
virtual

Interact with object.

Parameters
dttime step
poobject to interact with
wworld where the interaction takes place

Reimplemented from Enki::LocalInteraction.

References absOrientation, absPos, Enki::Vector::angle(), drawTexturedLine(), halfFieldOfView, height, image, Enki::Vector::norm(), Enki::normalizeAngle(), Enki::PhysicalObject::pos, and zbuffer.

Referenced by Enki::OmniCam::objectStep().

void Enki::CircularCam::wallsStep ( double  dt,
World w 
)
virtual

The documentation for this class was generated from the following files: