Fawkes API  Fawkes Development Version
firevision::ScanlineBeams Class Reference

Raytraced beams scanline model. More...

#include <>>

Inheritance diagram for firevision::ScanlineBeams:

Public Member Functions

 ScanlineBeams (unsigned int image_width, unsigned int image_height, unsigned int start_x, unsigned int start_y, unsigned int stop_y, unsigned int offset_y, bool distribute_start_x, float angle_from, float angle_range, unsigned int num_beams)
 Construtor. More...
 
fawkes::upoint_t operator* ()
 Get the current coordinate. More...
 
fawkes::upoint_toperator-> ()
 Get pointer to current point. More...
 
fawkes::upoint_toperator++ ()
 Postfix ++ operator. More...
 
fawkes::upoint_toperator++ (int)
 Prefix ++ operator. More...
 
bool finished ()
 Check if all desired points have been processed. More...
 
void reset ()
 Reset model. More...
 
const char * get_name ()
 Get name of scanline model. More...
 
unsigned int get_margin ()
 Get margin around points. More...
 
virtual void set_robot_pose (float x, float y, float ori)
 Set the robot's pose. More...
 
virtual void set_pan_tilt (float pan, float tilt)
 Set camera's pan/tilt values. More...
 
- Public Member Functions inherited from firevision::ScanlineModel
virtual ~ScanlineModel ()
 Virtual empty destructor. More...
 
virtual void set_roi (ROI *roi=NULL)
 Set the region-of-interest. More...
 

Detailed Description

Raytraced beams scanline model.

This model uses a defined number of beams shot from the bottom of the image towards the top using Bresenham. With this you can have kind of a radar-like scanline model. Additionally the starting points at the bottom can be distributed over the full width of the image which alles for a scan aligned to the image.

To ease the calculation of the finished state the very last point is traversed twice.

Author
Tim Niemueller

Definition at line 37 of file beams.h.

Constructor & Destructor Documentation

◆ ScanlineBeams()

firevision::ScanlineBeams::ScanlineBeams ( unsigned int  image_width,
unsigned int  image_height,
unsigned int  start_x,
unsigned int  start_y,
unsigned int  stop_y,
unsigned int  offset_y,
bool  distribute_start_x,
float  angle_from,
float  angle_range,
unsigned int  num_beams 
)

Construtor.

Parameters
image_widthimage width
image_heightimage height
start_xx coordinate of the starting point, ignored if distributed (see below)
start_yy coordinate of the starting point, this is the lowest points of the the lines and should thus be close to the bottom of the image
stop_yY coordinate for stopping the traversal
offset_ynumber of pixel to advance in Y-direction per iteration
distribute_start_xset to true, to distribute the start x coordinates equidistant over the whole width of the image.
angle_fromangle to start the scan at, a straight vertical line means zero rad, clock-wise positive, in radians
angle_rangethe range to use to distribute the beams, clockwise positive, in radians
num_beamsnumber of beams to use
Exceptions
Exceptionthrown if parameters are out of bounds

Definition at line 67 of file beams.cpp.

References reset().

Member Function Documentation

◆ finished()

bool firevision::ScanlineBeams::finished ( )
virtual

Check if all desired points have been processed.

Returns
true if all pixels that the model defines have been iterated.

Implements firevision::ScanlineModel.

Definition at line 108 of file beams.cpp.

References fawkes::upoint_t::x, and fawkes::upoint_t::y.

◆ get_margin()

unsigned int firevision::ScanlineBeams::get_margin ( )
virtual

Get margin around points.

Models that do not use margins shall return zero. It shall be guaranteed that in this margin region around a point there is no other point that has been or will be returned in a full iteration.

Returns
margin around a point.

Implements firevision::ScanlineModel.

Definition at line 268 of file beams.cpp.

◆ get_name()

const char * firevision::ScanlineBeams::get_name ( )
virtual

Get name of scanline model.

Returns
name of scanline model.

Implements firevision::ScanlineModel.

Definition at line 261 of file beams.cpp.

◆ operator*()

upoint_t firevision::ScanlineBeams::operator* ( )
virtual

Get the current coordinate.

Returns
current point in image that is shall be processed.

Implements firevision::ScanlineModel.

Definition at line 95 of file beams.cpp.

◆ operator++() [1/2]

upoint_t * firevision::ScanlineBeams::operator++ ( )
virtual

Postfix ++ operator.

Advances to the next point and returns the new point.

Returns
pointer to new point

Implements firevision::ScanlineModel.

Definition at line 206 of file beams.cpp.

◆ operator++() [2/2]

upoint_t * firevision::ScanlineBeams::operator++ ( int  )
virtual

Prefix ++ operator.

Advances to the next point but returns the old point.

Returns
pointer to next point

Implements firevision::ScanlineModel.

Definition at line 214 of file beams.cpp.

References fawkes::upoint_t::x, and fawkes::upoint_t::y.

◆ operator->()

upoint_t * firevision::ScanlineBeams::operator-> ( )
virtual

Get pointer to current point.

Returns
pointer to current point
See also
operator*()

Implements firevision::ScanlineModel.

Definition at line 101 of file beams.cpp.

◆ reset()

void firevision::ScanlineBeams::reset ( )
virtual

Reset model.

Resets the set of processed points.

Implements firevision::ScanlineModel.

Definition at line 224 of file beams.cpp.

References fawkes::upoint_t::x, and fawkes::upoint_t::y.

Referenced by ScanlineBeams().

◆ set_pan_tilt()

virtual void firevision::ScanlineBeams::set_pan_tilt ( float  pan,
float  tilt 
)
inlinevirtual

Set camera's pan/tilt values.

Parameters
pancamera's current pan
tiltcamera's current tilt

Implements firevision::ScanlineModel.

Definition at line 59 of file beams.h.

◆ set_robot_pose()

virtual void firevision::ScanlineBeams::set_robot_pose ( float  x,
float  y,
float  ori 
)
inlinevirtual

Set the robot's pose.

Parameters
xrobot's x coordinate on field in meters
yrobot's y coordinate on field in meters
orirobot's orientation. Looking towards the opponent goal is zero rad, with positive values pointing to the right, negative to the left.

Implements firevision::ScanlineModel.

Definition at line 58 of file beams.h.


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