Fawkes API
Fawkes Development Version
|
24 #include <core/exceptions/software.h>
25 #include <fvmodels/scanlines/grid.h>
31 namespace firevision {
50 unsigned int offset_x,
51 unsigned int offset_y,
56 setGridParams(width, height, offset_x, offset_y, roi, horizontal_grid);
78 ScanlineGrid::calc_next_coord()
83 if (horizontal_grid) {
84 if (
static_cast<int>(coord.
x) <
static_cast<int>(roi->
image_width - offset_x)) {
87 if (
static_cast<int>(coord.
y) <
static_cast<int>(roi->
image_height - offset_y)) {
96 if (
static_cast<int>(coord.
y) <
static_cast<int>(roi->
image_height - offset_y)) {
99 if (
static_cast<int>(coord.
x) <
static_cast<int>(roi->
image_width - offset_x)) {
103 more_to_come =
false;
119 memcpy(&tmp_coord, &coord,
sizeof(
upoint_t));
127 return !more_to_come;
142 return "ScanlineModel::Grid";
148 return (offset_x > offset_y) ? offset_x : offset_y;
167 this->roi =
new ROI(0, 0, this->width, this->height, this->width, this->height);
170 this->roi =
new ROI(roi);
205 this->height = height;
218 this->offset_x = offset_x;
219 this->offset_y = offset_y;
239 unsigned int offset_x,
240 unsigned int offset_y,
242 bool horizontal_grid)
244 this->horizontal_grid = horizontal_grid;
virtual ~ScanlineGrid()
Destructor.
unsigned int width
ROI width.
ScanlineGrid(unsigned int width, unsigned int height, unsigned int offset_x, unsigned int offset_y, ROI *roi=NULL, bool horizontal_grid=true)
Constructor.
unsigned int image_width
width of image that contains this ROI
unsigned int image_height
height of image that contains this ROI
Point with cartesian coordinates as unsigned integers.
fawkes::upoint_t operator*()
Get the current coordinate.
unsigned int height
ROI height.
virtual void set_robot_pose(float x, float y, float ori)
Set the robot's pose.
void setDimensions(unsigned int width, unsigned int height, ROI *roi=NULL)
Set dimensions.
void setOffset(unsigned int offset_x, unsigned int offset_y)
Set offset.
unsigned int y
y coordinate
void setGridParams(unsigned int width, unsigned int height, unsigned int offset_x, unsigned int offset_y, ROI *roi=NULL, bool horizontal_grid=true)
Set all grid parameters.
unsigned int get_margin()
Get margin around points.
fawkes::upoint_t * operator->()
Get pointer to current point.
fawkes::upoint_t * operator++()
Postfix ++ operator.
virtual void set_pan_tilt(float pan, float tilt)
Set camera's pan/tilt values.
fawkes::upoint_t start
ROI start.
const char * get_name()
Get name of scanline model.
unsigned int x
x coordinate
bool finished()
Check if all desired points have been processed.
virtual void set_roi(ROI *roi=NULL)
Set the region-of-interest.