#include <models/scanlines/beams.h>
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. | |
fawkes::point_t | operator * () |
Get the current coordinate. | |
fawkes::point_t * | operator-> () |
Get pointer to current point. | |
fawkes::point_t * | operator++ () |
Postfix ++ operator. | |
fawkes::point_t * | operator++ (int) |
Prefix ++ operator. | |
bool | finished () |
Check if all desired points have been processed. | |
void | reset () |
Reset model. | |
const char * | get_name () |
Get name of scanline model. | |
unsigned int | get_margin () |
Get margin around points. | |
virtual void | set_robot_pose (float x, float y, float ori) |
Set the robot's pose. | |
virtual void | set_pan_tilt (float pan, float tilt) |
Set camera's pan/tilt values. |
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.
Definition at line 37 of file beams.h.
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.
image_width | image width | |
image_height | image height | |
start_x | x coordinate of the starting point, ignored if distributed (see below) | |
start_y | y 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_y | Y coordinate for stopping the traversal | |
offset_y | number of pixel to advance in Y-direction per iteration | |
distribute_start_x | set to true, to distribute the start x coordinates equidistant over the whole width of the image. | |
angle_from | angle to start the scan at, a straight vertical line means zero rad, clock-wise positive, in radians | |
angle_range | the range to use to distribute the beams, clockwise positive, in radians | |
num_beams | number of beams to use |
Exception | thrown if parameters are out of bounds |
Definition at line 67 of file beams.cpp.
References reset().
bool firevision::ScanlineBeams::finished | ( | ) | [virtual] |
Check if all desired points have been processed.
Implements firevision::ScanlineModel.
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.
Implements firevision::ScanlineModel.
const char * firevision::ScanlineBeams::get_name | ( | ) | [virtual] |
point_t firevision::ScanlineBeams::operator * | ( | ) | [virtual] |
Get the current coordinate.
Implements firevision::ScanlineModel.
point_t * firevision::ScanlineBeams::operator++ | ( | int | ) | [virtual] |
Prefix ++ operator.
Advances to the next point but returns the old point.
Implements firevision::ScanlineModel.
Definition at line 214 of file beams.cpp.
References fawkes::point_t::x, and fawkes::point_t::y.
point_t * firevision::ScanlineBeams::operator++ | ( | ) | [virtual] |
Postfix ++ operator.
Advances to the next point and returns the new point.
Implements firevision::ScanlineModel.
point_t * firevision::ScanlineBeams::operator-> | ( | ) | [virtual] |
Get pointer to current point.
Implements firevision::ScanlineModel.
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::point_t::x, and fawkes::point_t::y.
Referenced by ScanlineBeams().
virtual void firevision::ScanlineBeams::set_pan_tilt | ( | float | pan, | |
float | tilt | |||
) | [inline, virtual] |
Set camera's pan/tilt values.
pan | camera's current pan | |
tilt | camera's current tilt |
Implements firevision::ScanlineModel.
virtual void firevision::ScanlineBeams::set_robot_pose | ( | float | x, | |
float | y, | |||
float | ori | |||
) | [inline, virtual] |
Set the robot's pose.
x | robot's x coordinate on field in meters | |
y | robot's y coordinate on field in meters | |
ori | robot's orientation. Looking towards the opponent goal is zero rad, with positive values pointing to the right, negative to the left. |
Implements firevision::ScanlineModel.