Robot Simulator of the Robotics Group for Self-Organization of Control: MotionCameraSensor Class Reference

# MotionCameraSensor Class Reference

This CameraSensor calculates the global optical flow of the camera image using the center of gravity method. More...

`#include <camerasensors.h>`

Inherits lpzrobots::PositionCameraSensor.

Collaboration diagram for MotionCameraSensor:
[legend]

List of all members.

## Public Member Functions
| MotionCameraSensor (const MotionCameraSensorConf &mconf=getDefaultConf())
| The camera image should be black and white (e.g.
virtual | ~MotionCameraSensor ()
virtual bool | sense (const GlobalData &globaldata)
| Performs the calculations.
double | windowfunc (double x)
| window function for the interval -1 to 1, with ramps from 0.5 off center
## Static Public Member Functions
static MotionCameraSensorConf | getDefaultConf ()
## Protected Attributes
MotionCameraSensorConf | mconf
double | lambda
bool | last
| whether last image had a valid position
double | lastX
double | lastY

## Detailed Description

This CameraSensor calculates the global optical flow of the camera image using the center of gravity method.

It requires objects to be bright on black ground. The velocity is by default windowed to avoid step-like artefacts at the border. Probably you want to use an image processor like ColorFilterImgProc before.

## Constructor & Destructor Documentation

MotionCameraSensor | ( | const MotionCameraSensorConf & | mconf = `getDefaultConf()` | ) | `[inline]`

The camera image should be black and white (e.g.

See also:
  BWImageProcessor or ColorFilterImgProc)
  CameraSensor for further parameter explanation.

Parameters:

  | mconf | configuration object

See also:
  MotionCameraSensorConf and
  PositionCameraSensorConf

virtual ~MotionCameraSensor | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

static MotionCameraSensorConf getDefaultConf | ( |  | ) | `[inline, static]`

Reimplemented from PositionCameraSensor.

virtual bool sense | ( | const GlobalData & | globaldata | ) | `[inline, virtual]`

Performs the calculations.

Reimplemented from PositionCameraSensor.

double windowfunc | ( | double | x | ) | `[inline]`

window function for the interval -1 to 1, with ramps from 0.5 off center

## Member Data Documentation

double lambda`[protected]`

bool last`[protected]`

whether last image had a valid position

double lastX`[protected]`

double lastY`[protected]`

MotionCameraSensorConf mconf`[protected]`

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

- camerasensors.h