Class to connect a Camera as a sensor to a robot. More...
#include <camerasensor.h>
Inherits lpzrobots::Sensor.
Inherited by DirectCameraSensor, OpticalFlow, and PositionCameraSensor.
Public Member Functions | |
CameraSensor () | |
Creates a camera sensor. | |
virtual | ~CameraSensor () |
virtual void | setInitData (Camera *camera, const OdeHandle &odeHandle, const OsgHandle &osgHandle, const osg::Matrix &pose) |
sets the initial data structures like the camera. | |
virtual void | setPose (const osg::Matrix &pose) |
changes the relative pose of the camera | |
virtual osg::Matrix | getPose () |
relative pose of the camera | |
virtual void | init (Primitive *own) |
this function initialized the camera (no need to overload) (Sensor interface) | |
virtual bool | sense (const GlobalData &globaldata)=0 |
overload this function an process the image (use camera->getImage()) | |
virtual int | getSensorNumber () const =0 |
overload this function and return the number of sensor values | |
virtual int | get (sensor *sensors, int length) const =0 |
overload this function and return the sensor values | |
virtual void | update () |
we update the camera's visual appearance | |
virtual std::list< sensor > | get () const |
this is implemented based on get(sensor*,int) | |
Protected Member Functions | |
virtual void | intern_init ()=0 |
overload this function to initialized you data structures. | |
Protected Attributes | |
Camera * | camera |
OdeHandle | odeHandle |
OsgHandle | osgHandle |
osg::Matrix | pose |
bool | isInitDataSet |
Class to connect a Camera as a sensor to a robot.
Essentially it implements the conversion from the 2D image to a list of double sensor values. The initialization is a bit confusing: use the contructor (of a inherited class) to provide custom parameter; setInitData sets the handles and the camera which has to be called before the normal initialization of the Sensor (via init()). A subclass has to overload intern_init() to initialize intern structures (e.g. number of channels), sense() and get().
CameraSensor | ( | ) |
Creates a camera sensor.
Use setInitData() to make it useable.
~CameraSensor | ( | ) | [virtual] |
virtual std::list<sensor> get | ( | ) | const [virtual] |
this is implemented based on get(sensor*,int)
Implements Sensor.
virtual int get | ( | sensor * | sensors, | |
int | length | |||
) | const [pure virtual] |
overload this function and return the sensor values
Reimplemented from Sensor.
Implemented in DirectCameraSensor, PositionCameraSensor, and OpticalFlow.
osg::Matrix getPose | ( | ) | [virtual] |
relative pose of the camera
returns the relative pose of the camera
virtual int getSensorNumber | ( | ) | const [pure virtual] |
overload this function and return the number of sensor values
Implements Sensor.
Implemented in DirectCameraSensor, PositionCameraSensor, and OpticalFlow.
void init | ( | Primitive * | own | ) | [virtual] |
virtual void intern_init | ( | ) | [protected, pure virtual] |
overload this function to initialized you data structures.
Use camera->getImage() to get the image from the camera
Implemented in DirectCameraSensor, PositionCameraSensor, and OpticalFlow.
virtual bool sense | ( | const GlobalData & | globaldata | ) | [pure virtual] |
overload this function an process the image (use camera->getImage())
Implements Sensor.
Implemented in DirectCameraSensor, PositionCameraSensor, MotionCameraSensor, and OpticalFlow.
void setInitData | ( | Camera * | camera, | |
const OdeHandle & | odeHandle, | |||
const OsgHandle & | osgHandle, | |||
const osg::Matrix & | pose | |||
) | [virtual] |
void setPose | ( | const osg::Matrix & | pose | ) | [virtual] |
changes the relative pose of the camera
void update | ( | ) | [virtual] |
we update the camera's visual appearance
Reimplemented from Sensor.
bool isInitDataSet [protected] |
osg::Matrix pose [protected] |